summaryrefslogtreecommitdiffstats
path: root/users
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-25 18:37:09 -0700
committerAndrew Godwin2022-11-25 18:37:09 -0700
commitab7a8cb120fe905562281b331a08e87abeff0fbe (patch)
tree59c168308439de972ec2c0e03f0b699219babadb /users
parent95bad674b5b360baea58ebef481cfd9c151b7c3d (diff)
downloadtakahe-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.py2
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)