misc: style (#41949)

This commit is contained in:
Benjamin Dauvergne 2020-04-24 13:08:09 +02:00
parent 482aa09f92
commit 24f96bb6c9
2 changed files with 17 additions and 15 deletions

View File

@ -374,8 +374,9 @@ class DefaultAdapter(object):
continue
values = saml_attributes.get(saml_attribute)
if not values:
logger.warning('looking for user by saml attribute %r and user field %r, skipping because empty',
saml_attribute, user_field)
logger.warning(
'looking for user by saml attribute %r and user field %r, skipping because empty',
saml_attribute, user_field)
continue
ignore_case = line.get('ignore-case', False)
for value in values:

View File

@ -202,16 +202,17 @@ class LoginView(ProfileMixin, LogMixin, View):
if error_url:
error_url = resolve_url(error_url)
next_url = error_url or self.get_next_url(default=resolve_url(settings.LOGIN_REDIRECT_URL))
return self.render(request, 'mellon/authentication_failed.html',
{
'debug': settings.DEBUG,
'reason': reason,
'status_codes': status_codes,
'issuer': login.remoteProviderId,
'next_url': next_url,
'relaystate': login.msgRelayState,
'error_redirect_after_timeout': error_redirect_after_timeout,
})
return self.render(
request, 'mellon/authentication_failed.html',
{
'debug': settings.DEBUG,
'reason': reason,
'status_codes': status_codes,
'issuer': login.remoteProviderId,
'next_url': next_url,
'relaystate': login.msgRelayState,
'error_redirect_after_timeout': error_redirect_after_timeout,
})
def get_attribute_value(self, attribute, attribute_value):
# check attribute_value contains only text
@ -289,9 +290,9 @@ class LoginView(ProfileMixin, LogMixin, View):
'saml_attributes': attributes})
else:
self.log.warning('no user found for NameID %r', attributes['name_id_content'])
return self.render(request, 'mellon/user_not_found.html', {
'saml_attributes': attributes
})
return self.render(
request, 'mellon/user_not_found.html',
{'saml_attributes': attributes})
request.session['lasso_session_dump'] = login.session.dump()
return HttpResponseRedirect(next_url)