summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-12-18 09:25:44 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-12-18 09:25:44 (GMT)
commitb4a08778bf7c72a9829b271a0bb4cc0423099b49 (patch)
tree6439003d0230c4e0a86aba8ff1cbb3b51f99b78b
parent7802e85d522dbab4743dbeceb5081124bbb6be34 (diff)
downloaddjango-mellon-b4a08778bf7c72a9829b271a0bb4cc0423099b49.zip
django-mellon-b4a08778bf7c72a9829b271a0bb4cc0423099b49.tar.gz
django-mellon-b4a08778bf7c72a9829b271a0bb4cc0423099b49.tar.bz2
misc: use compat.is_authenticated() in logout views (#38613)v1.13
-rw-r--r--mellon/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mellon/views.py b/mellon/views.py
index 381ec45..c2c2573 100644
--- a/mellon/views.py
+++ b/mellon/views.py
@@ -38,7 +38,7 @@ from django.db import transaction
from django.utils.translation import ugettext as _
from . import app_settings, utils
-from .compat import reverse
+from .compat import reverse, is_authenticated
RETRY_LOGIN_COOKIE = 'MELLON_RETRY_LOGIN'
@@ -529,7 +529,7 @@ class LogoutView(ProfileMixin, LogMixin, View):
next_url = request.GET.get(REDIRECT_FIELD_NAME)
referer = request.META.get('HTTP_REFERER')
if not referer or utils.same_origin(referer, request.build_absolute_uri()):
- if request.user.is_authenticated():
+ if hasattr(request, 'user') and is_authenticated(request.user):
logout = None
try:
issuer = request.session.get('mellon_session', {}).get('issuer')