diff --git a/colleges/permissions.py b/colleges/permissions.py index 3ded6a384b3a15141acb4fde6a740f7b41ac4e74..f6631d5188389da9cf77af3af7687b8676825c68 100644 --- a/colleges/permissions.py +++ b/colleges/permissions.py @@ -9,7 +9,7 @@ from django.core.exceptions import PermissionDenied def fellowship_required(): """Require user to have any Fellowship or Administrational permissions.""" def test(u): - if u.is_authenticated(): + if u.is_authenticated: if hasattr(u, 'contributor') and u.contributor.fellowships.exists(): # Fellow return True @@ -20,7 +20,7 @@ def fellowship_required(): def fellowship_or_admin_required(): """Require user to have any Fellowship or Administrational permissions.""" def test(u): - if u.is_authenticated(): + if u.is_authenticated: if hasattr(u, 'contributor') and u.contributor.fellowships.exists(): # Fellow return True diff --git a/notifications/views.py b/notifications/views.py index a98a37183f284f429ea851bfbe2898c1248c7ca4..7cfdfc817785c3110abdc98b1cc41c0393f59132 100644 --- a/notifications/views.py +++ b/notifications/views.py @@ -56,7 +56,7 @@ def mark_toggle(request, slug=None): def live_unread_notification_count(request): """Return JSON of unread messages count.""" - if not request.user.is_authenticated(): + if not request.user.is_authenticated: data = {'unread_count': 0} else: data = {'unread_count': request.user.notifications.unread().count()} @@ -65,7 +65,7 @@ def live_unread_notification_count(request): def live_notification_list(request): """Return JSON of unread count and content of messages.""" - # if not request.user.is_authenticated(): + # if not request.user.is_authenticated: # data = { # 'unread_count': 0, # 'list': [] diff --git a/petitions/forms.py b/petitions/forms.py index f72c516bd455eb914ac8392ea0f1df6bddb6a58d..94ab04f014705664a115bcd4b6cccb65365ad417 100644 --- a/petitions/forms.py +++ b/petitions/forms.py @@ -30,7 +30,7 @@ class SignPetitionForm(forms.ModelForm): if self.instance.id: return email - if self.current_user.is_authenticated(): + if self.current_user.is_authenticated: if self.current_user.email != email: self.add_error('email', 'This email address is not associated to your account') else: diff --git a/production/permissions.py b/production/permissions.py index 95723d4bf79ae044664d678d85555fa5d019e182..456800860c88ee98857de1283def9a8e74acb4e4 100644 --- a/production/permissions.py +++ b/production/permissions.py @@ -8,7 +8,7 @@ from django.contrib.auth.decorators import user_passes_test def is_production_user(): """Requires user to be a ProductionUser.""" def test(u): - if u.is_authenticated(): + if u.is_authenticated: if hasattr(u, 'production_user') and u.production_user: return True return False diff --git a/scipost/decorators.py b/scipost/decorators.py index d45d9bc0532728fc68c11143e961e8bf854687c4..9c83af41dfac53a0ecd74166cb3f5095f13cd37b 100644 --- a/scipost/decorators.py +++ b/scipost/decorators.py @@ -19,7 +19,7 @@ def has_contributor(user): def is_contributor_user(): """Decorator checking if user is related to any Contributor.""" def test(u): - if u.is_authenticated(): + if u.is_authenticated: return has_contributor(u) return False return user_passes_test(test) diff --git a/scipost/views.py b/scipost/views.py index 68577519c59f7fa08a56dd642b7c94c54b95ad00..5dfae5e57ea16b2c84f6f5bd3f4d784b21445cb5 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -174,7 +174,7 @@ def register(request): sent. After activation the user needs to be vetted by the SciPost admin. """ - if request.user.is_authenticated(): + if request.user.is_authenticated: return redirect(reverse('scipost:personal_page')) form = RegistrationForm(request.POST or None)