From dd72013225fa16e563851c41ea59a9ee57b4809c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 9 Dec 2023 08:09:22 -0800 Subject: [PATCH] Small fixes for notifications Adds a link in the text of the notification, and fixes references to notification type in the model --- bookwyrm/models/notification.py | 4 ++-- bookwyrm/templates/notifications/items/user_import.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bookwyrm/models/notification.py b/bookwyrm/models/notification.py index 515346031..ca1e2aeb0 100644 --- a/bookwyrm/models/notification.py +++ b/bookwyrm/models/notification.py @@ -249,7 +249,7 @@ def notify_user_on_user_import_complete( if not instance.complete or "complete" not in update_fields: return Notification.objects.create( - user=instance.user, notification_type=Notification.USER_IMPORT + user=instance.user, notification_type=NotificationType.USER_IMPORT ) @@ -264,7 +264,7 @@ def notify_user_on_user_export_complete( return Notification.objects.create( user=instance.user, - notification_type=Notification.USER_EXPORT, + notification_type=NotificationType.USER_EXPORT, related_user_export=instance, ) diff --git a/bookwyrm/templates/notifications/items/user_import.html b/bookwyrm/templates/notifications/items/user_import.html index 2e9838688..27e3e975d 100644 --- a/bookwyrm/templates/notifications/items/user_import.html +++ b/bookwyrm/templates/notifications/items/user_import.html @@ -10,5 +10,7 @@ {% endblock %} {% block description %} - {% blocktrans %}Your user import is complete.{% endblocktrans %} +{% url 'user-import' as import_url %} +{% blocktrans %}Your user import is complete.{% endblocktrans %} + {% endblock %}