Don't error admin decorator on anonymous
This commit is contained in:
parent
95bad674b5
commit
ab7a8cb120
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue