diff --git a/horizon/templates/horizon/auth/_login.html b/horizon/templates/horizon/auth/_login.html index f3a6d1b9e..a73a926ec 100644 --- a/horizon/templates/horizon/auth/_login.html +++ b/horizon/templates/horizon/auth/_login.html @@ -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 %} diff --git a/horizon/views/auth_forms.py b/horizon/views/auth_forms.py index 2ebecfcda..92586d0b0 100644 --- a/horizon/views/auth_forms.py +++ b/horizon/views/auth_forms.py @@ -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, "")