diff --git a/app/blueprints/admin/actions.py b/app/blueprints/admin/actions.py index fb53f772..5c5d795a 100644 --- a/app/blueprints/admin/actions.py +++ b/app/blueprints/admin/actions.py @@ -237,15 +237,15 @@ def remind_outdated(): @action("Import licenses from SPDX") def import_licenses(): renames = { - "GPLv2" : "GPL-2.0-only", - "GPLv3" : "GPL-3.0-only", - "AGPLv2" : "AGPL-2.0-only", - "AGPLv3" : "AGPL-3.0-only", - "LGPLv2.1" : "LGPL-2.1-only", - "LGPLv3" : "LGPL-3.0-only", - "Apache 2.0" : "Apache-2.0", + "GPLv2": "GPL-2.0-only", + "GPLv3": "GPL-3.0-only", + "AGPLv2": "AGPL-2.0-only", + "AGPLv3": "AGPL-3.0-only", + "LGPLv2.1": "LGPL-2.1-only", + "LGPLv3": "LGPL-3.0-only", + "Apache 2.0": "Apache-2.0", "BSD 2-Clause / FreeBSD": "BSD-2-Clause-FreeBSD", - "BSD 3-Clause" : "BSD-3-Clause", + "BSD 3-Clause": "BSD-3-Clause", "CC0": "CC0-1.0", "CC BY 3.0": "CC-BY-3.0", "CC BY 4.0": "CC-BY-4.0", diff --git a/app/templates/todo/user.html b/app/templates/todo/user.html index 31b11604..739c86c8 100644 --- a/app/templates/todo/user.html +++ b/app/templates/todo/user.html @@ -5,6 +5,15 @@ {% endblock %} {% block content %} + {% if user.notification_preferences is none %} +

{{ _("Misc To do") }}

+
+ + {{ _("Enable email notifications") }} + +
+ {% endif %}

{{ _("Unapproved Packages Needing Action") }}

{% for package in unapproved_packages %} diff --git a/app/utils/user.py b/app/utils/user.py index c3ff511b..942fde53 100644 --- a/app/utils/user.py +++ b/app/utils/user.py @@ -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"))