aboutsummaryrefslogtreecommitdiff
path: root/app/views/notifications.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-29 17:20:11 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-29 17:20:11 +0100
commit52fdc8c2120e459772e221c68b25bf6e7060f6f8 (patch)
treeebb9a1d16fc2ca4b13e3ea7ca332021b8c6e61b7 /app/views/notifications.py
parent7e80adad5621013e5840ac43281cff149fa15842 (diff)
downloadcheatdb-52fdc8c2120e459772e221c68b25bf6e7060f6f8.tar.xz
Add clear all button to notifications page
Diffstat (limited to 'app/views/notifications.py')
-rw-r--r--app/views/notifications.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/views/notifications.py b/app/views/notifications.py
index 4515ae5..23dbb31 100644
--- a/app/views/notifications.py
+++ b/app/views/notifications.py
@@ -23,4 +23,11 @@ from app.models import *
@app.route("/notifications/")
@login_required
def notifications_page():
- return render_template("notifications/list.html")
+ return render_template("notifications/list.html")
+
+@app.route("/notifications/clear/", methods=["POST"])
+@login_required
+def clear_notifications_page():
+ current_user.notifications.clear()
+ db.session.commit()
+ return redirect(url_for("notifications_page"))