mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-25 01:12:16 +00:00
User.is_authenticated is no longer callable
This commit is contained in:
@@ -23,7 +23,7 @@ def user_passes_test_with_403(test_func, login_url=None, oembed_view=None):
|
|||||||
def _checklogin(request, *args, **kwargs):
|
def _checklogin(request, *args, **kwargs):
|
||||||
if test_func(request.user):
|
if test_func(request.user):
|
||||||
return view_func(request, *args, **kwargs)
|
return view_func(request, *args, **kwargs)
|
||||||
elif not request.user.is_authenticated():
|
elif not request.user.is_authenticated:
|
||||||
if oembed_view is not None:
|
if oembed_view is not None:
|
||||||
context = {}
|
context = {}
|
||||||
context['oembed_url'] = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], reverse(oembed_view, kwargs=kwargs))
|
context['oembed_url'] = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], reverse(oembed_view, kwargs=kwargs))
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Index(generic.TemplateView):
|
|||||||
|
|
||||||
|
|
||||||
def login(request, **kwargs):
|
def login(request, **kwargs):
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated:
|
||||||
next = request.GET.get('next', '/')
|
next = request.GET.get('next', '/')
|
||||||
return HttpResponseRedirect(next)
|
return HttpResponseRedirect(next)
|
||||||
else:
|
else:
|
||||||
@@ -49,7 +49,7 @@ def login(request, **kwargs):
|
|||||||
# check for it before logging the user in
|
# check for it before logging the user in
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
def login_embed(request, **kwargs):
|
def login_embed(request, **kwargs):
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated:
|
||||||
next = request.GET.get('next', '/')
|
next = request.GET.get('next', '/')
|
||||||
return HttpResponseRedirect(next)
|
return HttpResponseRedirect(next)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user