Don't error admin decorator on anonymous

This commit is contained in:
Andrew Godwin 2022-11-25 18:37:09 -07:00
parent 95bad674b5
commit ab7a8cb120
1 changed files with 1 additions and 1 deletions

View File

@ -30,4 +30,4 @@ def identity_required(function):
def admin_required(function):
return user_passes_test(lambda user: user.admin)(function)
return user_passes_test(lambda user: user.is_authenticated and user.admin)(function)