Merge "Show WEBSSO disclaimer only when it is needed"

This commit is contained in:
Zuul 2018-06-04 16:19:30 +00:00 committed by Gerrit Code Review
commit 94aea2fedd
2 changed files with 6 additions and 0 deletions

View File

@ -30,7 +30,9 @@
<input type="password" name="fake_password" value="" /> <input type="password" name="fake_password" value="" />
</div> </div>
{%endif%} {%endif%}
{% if show_sso_opts %}
{% include "auth/_description.html" %} {% include "auth/_description.html" %}
{% endif %}
<fieldset hz-login-finder> <fieldset hz-login-finder>
{% if request.user.is_authenticated and 'next' in request.GET %} {% if request.user.is_authenticated and 'next' in request.GET %}
<div class="form-group clearfix error help-block alert alert-danger"> <div class="form-group clearfix error help-block alert alert-danger">

View File

@ -92,6 +92,10 @@ def login(request, template_name=None, extra_context=None, **kwargs):
extra_context['csrf_failure'] = request.GET.get('csrf_failure') extra_context['csrf_failure'] = request.GET.get('csrf_failure')
choices = getattr(settings, 'WEBSSO_CHOICES', ())
extra_context['show_sso_opts'] = (utils.is_websso_enabled() and
len(choices) > 1)
if not template_name: if not template_name:
if request.is_ajax(): if request.is_ajax():
template_name = 'auth/_login.html' template_name = 'auth/_login.html'