Commit f3318465 by zubair-arbi

move enterprise specific code to separate method "_update_context_error_message_for_enterprise"

parent e090d557
...@@ -381,6 +381,15 @@ def _third_party_auth_context(request, redirect_to, tpa_hint=None): ...@@ -381,6 +381,15 @@ def _third_party_auth_context(request, redirect_to, tpa_hint=None):
context['errorMessage'] = _(unicode(msg)) # pylint: disable=translation-of-non-string context['errorMessage'] = _(unicode(msg)) # pylint: disable=translation-of-non-string
break break
context = _update_context_for_enterprise_error_message(context, enterprise_customer)
return context
def _update_context_for_enterprise_error_message(context, enterprise_customer=None):
"""
Return updated context with modified `errorMessage` for enterprise.
"""
if enterprise_customer and context['errorMessage']: if enterprise_customer and context['errorMessage']:
context['errorMessage'] = Text(_( context['errorMessage'] = Text(_(
u'We are sorry, you are not authorized to access {platform_name} via this channel. ' u'We are sorry, you are not authorized to access {platform_name} via this channel. '
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment