diff options
author | Andrew Godwin | 2022-11-25 18:37:09 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-25 18:37:09 -0700 |
commit | ab7a8cb120fe905562281b331a08e87abeff0fbe (patch) | |
tree | 59c168308439de972ec2c0e03f0b699219babadb /users | |
parent | 95bad674b5b360baea58ebef481cfd9c151b7c3d (diff) | |
download | takahe-ab7a8cb120fe905562281b331a08e87abeff0fbe.tar.gz takahe-ab7a8cb120fe905562281b331a08e87abeff0fbe.tar.bz2 takahe-ab7a8cb120fe905562281b331a08e87abeff0fbe.zip |
Don't error admin decorator on anonymous
Diffstat (limited to 'users')
-rw-r--r-- | users/decorators.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/users/decorators.py b/users/decorators.py index 5226460..26778ec 100644 --- a/users/decorators.py +++ b/users/decorators.py @@ -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) |