From 56e739bd32a474f38507e0628f50d0bbab2ce534 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Wed, 13 Dec 2017 15:40:00 +0100 Subject: [PATCH] Correctly use is_authenticated as property. --- ticdesk/contextprocessors.py | 2 +- ticdesk_events/views.py | 2 +- ticdesk_org/util.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ticdesk/contextprocessors.py b/ticdesk/contextprocessors.py index 2ed42d8..74872ce 100644 --- a/ticdesk/contextprocessors.py +++ b/ticdesk/contextprocessors.py @@ -5,7 +5,7 @@ TeckidsPerson = apps.get_model('ticdesk_account', 'TeckidsPerson') def person_context(request): context = {} - if request.user.is_authenticated(): + if request.user.is_authenticated: person = TeckidsPerson.objects.get(uid=request.user.username) context['current_person'] = person diff --git a/ticdesk_events/views.py b/ticdesk_events/views.py index 81a5221..ab4f74c 100644 --- a/ticdesk_events/views.py +++ b/ticdesk_events/views.py @@ -33,7 +33,7 @@ def register_event(request, cn): context = {} # Only authenticated users an register for events - if not request.user.is_authenticated(): + if not request.user.is_authenticated: return redirect(reverse('ticdesk_account:login') + '?next=%s' % request.path) # Get current person and event diff --git a/ticdesk_org/util.py b/ticdesk_org/util.py index 93de204..20e9a16 100644 --- a/ticdesk_org/util.py +++ b/ticdesk_org/util.py @@ -13,7 +13,7 @@ logger = logging.getLogger(__name__) def may_see_group(group, user): # Not logged-in users cannot see anything - if not user.is_authenticated(): + if not user.is_authenticated: return False # Replace user variable it the user's TeckidsPerson @@ -45,7 +45,7 @@ def may_see_group(group, user): def may_see_person(person, user): # Not logged-in users cannot see anything - if not user.is_authenticated(): + if not user.is_authenticated: return False # Replace user variable with the user's TeckidsPerson @@ -80,7 +80,7 @@ def filter_disallowed_persons(persons, user): def get_relevant_groups(user): # Not logged-in users cannot see anything - if not user.is_authenticated(): + if not user.is_authenticated: return [] # Replace user variable with the user's TeckidsPerson -- GitLab