From 0e8e6464f66fe8940f18c75f65ec0104f2f7fca4 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 1 Apr 2020 20:43:26 +0200 Subject: [PATCH] is_authenticated is no longer a callable in newer Django --- django/archives/auth.py | 2 +- django/archives/mailarchives/views.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/django/archives/auth.py b/django/archives/auth.py index 4ae553b..87ffb0b 100644 --- a/django/archives/auth.py +++ b/django/archives/auth.py @@ -72,7 +72,7 @@ def login(request): # Handle logout requests by logging out of this site and then # redirecting to log out from the main site as well. def logout(request): - if request.user.is_authenticated(): + if request.user.is_authenticated: django_logout(request) return HttpResponseRedirect("%slogout/" % settings.PGAUTH_REDIRECT) diff --git a/django/archives/mailarchives/views.py b/django/archives/mailarchives/views.py index 5e01aa3..4a5729c 100644 --- a/django/archives/mailarchives/views.py +++ b/django/archives/mailarchives/views.py @@ -31,7 +31,7 @@ from .models import * def ensure_logged_in(request): if settings.PUBLIC_ARCHIVES: return - if hasattr(request, 'user') and request.user.is_authenticated(): + if hasattr(request, 'user') and request.user.is_authenticated: return raise ERedirect('%s?next=%s' % (settings.LOGIN_URL, request.path)) @@ -41,7 +41,7 @@ def ensure_logged_in(request): def ensure_list_permissions(request, l): if settings.PUBLIC_ARCHIVES: return - if hasattr(request, 'user') and request.user.is_authenticated(): + if hasattr(request, 'user') and request.user.is_authenticated: if request.user.is_superuser: return if l.subscriber_access and ListSubscriber.objects.filter(list=l, username=request.user.username).exists(): @@ -59,7 +59,7 @@ def ensure_list_permissions(request, l): def ensure_message_permissions(request, msgid): if settings.PUBLIC_ARCHIVES: return - if hasattr(request, 'user') and request.user.is_authenticated(): + if hasattr(request, 'user') and request.user.is_authenticated: if request.user.is_superuser: return @@ -635,7 +635,7 @@ def resend(request, messageid): if not settings.ALLOW_RESEND: raise PermissionDenied("Access denied.") - if not (hasattr(request, 'user') and request.user.is_authenticated()): + if not (hasattr(request, 'user') and request.user.is_authenticated): raise ERedirect('%s?next=%s' % (settings.LOGIN_URL, request.path)) ensure_message_permissions(request, messageid) -- 2.39.5