summaryrefslogtreecommitdiffstats
path: root/nfsw/auth.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-09-13 22:13:45 -0400
committerrsiddharth <s@ricketyspace.net>2019-09-13 22:13:45 -0400
commit32a70fea785f2f53132b369f99075b6fa2e99bbd (patch)
tree1e6b4848ef3ab9af828dfa0d466119ca7c905659 /nfsw/auth.py
parent42ca2d3366372e01d99b7b9d49fab662e3e0a1e2 (diff)
nfsw/auth.py: Add terms route.
Diffstat (limited to 'nfsw/auth.py')
-rw-r--r--nfsw/auth.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/nfsw/auth.py b/nfsw/auth.py
index 1652738..805d93c 100644
--- a/nfsw/auth.py
+++ b/nfsw/auth.py
@@ -130,3 +130,23 @@ def register():
return render()
+@bp.route('/terms', methods=('GET', 'POST'))
+@login_required
+@not_agreed
+def terms():
+ if request.method == 'POST':
+ if 'agree' not in request.form:
+ return redirect(url_for('auth.sorry'))
+
+ # Mark terms agreed.
+ db = get_db()
+ r = db.execute(
+ 'UPDATE user SET terms_agreed=1 WHERE id=?',
+ (g.user['id'],))
+ db.commit()
+
+ return redirect(url_for('io'))
+
+ return render_template('terms.html')
+
+