summaryrefslogtreecommitdiffstats
path: root/nfsw/auth.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-09-13 22:11:01 -0400
committerrsiddharth <s@ricketyspace.net>2019-09-13 22:11:01 -0400
commit82780edbfb98c2b784adb642b2cd8a8a15d033c8 (patch)
tree7cc56498a322cae8e7d54878d5f52c47fb2e0f48 /nfsw/auth.py
parent3dc0b70a2b1584b900bc4773c21a58ea39dd7c6a (diff)
nfsw/auth.py: Add not_agreed decorator.
Diffstat (limited to 'nfsw/auth.py')
-rw-r--r--nfsw/auth.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/nfsw/auth.py b/nfsw/auth.py
index d540a9a..769a5dd 100644
--- a/nfsw/auth.py
+++ b/nfsw/auth.py
@@ -38,3 +38,14 @@ def anon_only(view):
return wrapped_view
+def not_agreed(view):
+ @functools.wraps(view)
+ def wrapped_view(**kwargs):
+ if g.user['terms_agreed']:
+ return redirect(url_for('io'))
+
+ return view(**kwargs)
+
+ return wrapped_view
+
+