Add email notification prompt to post-login hook

This commit is contained in:
rubenwardy
2021-07-31 21:35:07 +01:00
parent aae546a08e
commit 6bbe2307e9
3 changed files with 21 additions and 8 deletions

View File

@@ -49,6 +49,10 @@ def post_login(user: User, next_url):
flash("You have a lot of notifications, you should either read or clear them", "info")
return redirect(url_for("notifications.list_all"))
if user.notification_preferences is None:
flash("Please consider enabling email notifications, you can customise how much is sent", "info")
return redirect(url_for("users.email_notifications", username=user.username))
return redirect(url_for("homepage.home"))