Restored functionality of the region switcher dropdown.

Fixes bug 1004222 and fixes bug 1004234.

Change-Id: I7bd61cdcac576600e6dea97e3b7c131dfb8d469c
This commit is contained in:
Gabriel Hurley 2012-05-24 16:34:50 -07:00
parent 629453f41e
commit 48e325dd90
2 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
{% load i18n %}
{% 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 %}

View File

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