Merge "Restored functionality of the region switcher dropdown."

This commit is contained in:
Jenkins 2012-05-25 00:34:41 +00:00 committed by Gerrit Code Review
commit 4f7ee81b58
2 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block modal-header %}{% trans "Log In" %}{% endblock %} {% block modal-header %}{% trans "Log In" %}{% endblock %}
{% block modal_class %}login{% endblock %} {% block modal_class %}login {% if hide %}modal hide{% endif %}{% endblock %}
{% block form_action %}{% url horizon:auth_login %}{% endblock %} {% block form_action %}{% url horizon:auth_login %}{% endblock %}

View File

@ -90,9 +90,11 @@ class Login(forms.SelfHandlingForm):
# For now we'll allow fallback to OPENSTACK_KEYSTONE_URL if the # For now we'll allow fallback to OPENSTACK_KEYSTONE_URL if the
# form post doesn't include a region. # form post doesn't include a region.
endpoint = data.get('region', None) or settings.OPENSTACK_KEYSTONE_URL endpoint = data.get('region', None) or settings.OPENSTACK_KEYSTONE_URL
if endpoint != request.session.get('region_endpoint', None):
region_name = dict(self.fields['region'].choices)[endpoint] region_name = dict(self.fields['region'].choices)[endpoint]
request.session['region_endpoint'] = endpoint request.session['region_endpoint'] = endpoint
request.session['region_name'] = region_name request.session['region_name'] = region_name
request.user.service_catalog = None
redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, "") redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, "")