dj2: is_anonymous is now an attribute (#37317)

RemovedInDjango20Warning:
Using user.is_authenticated() and user.is_anonymous() as a method is
deprecated. Remove the parentheses to use it as an attribute.
This commit is contained in:
Lauréline Guérin 2019-10-29 15:06:17 +01:00
parent c59b4b9e86
commit 52ff4d1bb4
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ def manager_required(function=None, login_url=None):
def check_manager(user):
if user and user.is_staff:
return True
if user and not user.is_anonymous():
if user and not user.is_anonymous:
# /manage/ is open to anyone authorized to view or edit an agenda.
group_ids = [x.id for x in user.groups.all()]
if Agenda.objects.filter(Q(view_role_id__in=group_ids) | Q(edit_role_id__in=group_ids)).exists():