User.is_authenticated is no longer a callable in Django 2.2
authorMagnus Hagander <magnus@hagander.net>
Wed, 1 Apr 2020 13:55:03 +0000 (15:55 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 1 Apr 2020 13:55:03 +0000 (15:55 +0200)
hamnadmin/hamnadmin/auth.py
hamnadmin/hamnadmin/register/views.py

index 4ae553b2f78f5080e6ca577c57fb9e95f87f8fbf..87ffb0b2adbcd45d956b7f625dc9ae29c7807bfa 100644 (file)
@@ -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)
 
index 42de9f6f77eb065e36270af4048c0d48dcd4c235..517d33133886abff4eb7e07c4de752526127ca82 100644 (file)
@@ -44,7 +44,7 @@ def planet_add(request):
 
 # Registration interface (login and all)
 def issuperuser(user):
-       return user.is_authenticated() and user.is_superuser
+       return user.is_authenticated and user.is_superuser
 
 @login_required
 def root(request):