From 575cfa4917351443e3285fbb5c7aa3bea91ab4f4 Mon Sep 17 00:00:00 2001 From: BubaVV Date: Tue, 5 Jun 2018 13:55:02 +0300 Subject: [PATCH] Show WEBSSO disclaimer only when it is needed Horizon can support several auth mechanisms, i.e. Keystone creds and OpenID. User allowed to choose proper way of auth and disclaimer is shown. But it is possible to allow choose from the only variant, and in this case disclaimer also shown, which is confusing. Proposed patch fix disclaimer display and makes it reasonable Change-Id: I4bba535c5700179dcfa02dfe774c82bf7ec70824 Related-issue: PROD-20214 --- openstack_auth/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openstack_auth/views.py b/openstack_auth/views.py index 7ae3063e..9bdd5416 100644 --- a/openstack_auth/views.py +++ b/openstack_auth/views.py @@ -90,6 +90,10 @@ def login(request, template_name=None, extra_context=None, **kwargs): if extra_context is None: extra_context = {'redirect_field_name': auth.REDIRECT_FIELD_NAME} + choices = getattr(settings, 'WEBSSO_CHOICES', ()) + extra_context['show_sso_opts'] = (utils.is_websso_enabled() and + len(choices) > 1) + if not template_name: if request.is_ajax(): template_name = 'auth/_login.html'