Merge pull request #2336 from bookwyrm-social/cancel-imports

Fixes duplicate notification on import
This commit is contained in:
Mouse Reeve 2022-11-07 10:47:38 -08:00 committed by GitHub
commit eb7777c0a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -214,7 +214,7 @@ def notify_user_on_import_complete(
update_fields = update_fields or []
if not instance.complete or "complete" not in update_fields:
return
Notification.objects.create(
Notification.objects.get_or_create(
user=instance.user,
notification_type=Notification.IMPORT,
related_import=instance,