From 42450b5a22dacd6cdbf2649dc03e5c99889463c9 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Sun, 25 Mar 2018 00:28:37 +0000 Subject: [PATCH] User.is_authenticated is no longer callable --- PyRIGS/decorators.py | 2 +- RIGS/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PyRIGS/decorators.py b/PyRIGS/decorators.py index c6c3b424..448839c8 100644 --- a/PyRIGS/decorators.py +++ b/PyRIGS/decorators.py @@ -23,7 +23,7 @@ def user_passes_test_with_403(test_func, login_url=None, oembed_view=None): def _checklogin(request, *args, **kwargs): if test_func(request.user): return view_func(request, *args, **kwargs) - elif not request.user.is_authenticated(): + elif not request.user.is_authenticated: if oembed_view is not None: context = {} context['oembed_url'] = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], reverse(oembed_view, kwargs=kwargs)) diff --git a/RIGS/views.py b/RIGS/views.py index a40eafb5..53a2a20d 100644 --- a/RIGS/views.py +++ b/RIGS/views.py @@ -34,7 +34,7 @@ class Index(generic.TemplateView): def login(request, **kwargs): - if request.user.is_authenticated(): + if request.user.is_authenticated: next = request.GET.get('next', '/') return HttpResponseRedirect(next) else: @@ -49,7 +49,7 @@ def login(request, **kwargs): # check for it before logging the user in @csrf_exempt def login_embed(request, **kwargs): - if request.user.is_authenticated(): + if request.user.is_authenticated: next = request.GET.get('next', '/') return HttpResponseRedirect(next) else: