mark a notification as read when user arrives on the notification page

This commit is contained in:
Son 2022-03-09 17:58:26 +01:00
parent b6b917eba8
commit 0e3a5c3d3c
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,10 @@ def notification_route(notification_id):
)
return redirect(url_for("dashboard.index"))
if not notification.read:
notification.read = True
Session.commit()
if request.method == "POST":
notification_title = notification.title or notification.message[:20]
Notification.delete(notification_id)