[authsaml2] Add setting option to display message
This commit is contained in:
parent
231931dab7
commit
07f46aabd2
|
@ -9,6 +9,7 @@ from django.utils.translation import ugettext as _
|
|||
from django.shortcuts import render_to_response
|
||||
from django.contrib.sessions.models import Session
|
||||
from django.contrib import messages
|
||||
from django.conf import settings
|
||||
|
||||
__redirection_timeout = 1600
|
||||
|
||||
|
@ -37,7 +38,8 @@ def error_page(request, message=None, back=None, logger=None,
|
|||
if timer:
|
||||
context['redir_timeout'] = __redirection_timeout
|
||||
context['next_page'] = back
|
||||
if default_message:
|
||||
display_message = getattr(settings, 'DISPLAY_MESSAGE_ERROR_PAGE', ())
|
||||
if default_message and not display_message:
|
||||
messages.add_message(request, messages.ERROR,
|
||||
_('An error happened. Report this %s to the administrator.') % \
|
||||
time.strftime("[%Y-%m-%d %a %H:%M:%S]", time.localtime()))
|
||||
|
|
|
@ -267,6 +267,7 @@ if AUTH_SAML2:
|
|||
'authentic2.authsaml2.backends.AuthSAML2TransientBackend')
|
||||
AUTH_FRONTENDS += ('authentic2.authsaml2.frontend.AuthSAML2Frontend',)
|
||||
IDP_BACKENDS += ('authentic2.authsaml2.backends.AuthSAML2Backend',)
|
||||
DISPLAY_MESSAGE_ERROR_PAGE = True
|
||||
|
||||
if AUTH_OPENID:
|
||||
INSTALLED_APPS += ('django_authopenid',)
|
||||
|
|
Loading…
Reference in New Issue