From 50ca3eef313145f152935650aed483fa7aa7a533 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 22 Sep 2021 11:10:37 -0700 Subject: [PATCH] Encompass all status models in notification signal --- bookwyrm/models/notification.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bookwyrm/models/notification.py b/bookwyrm/models/notification.py index d9542f5d3..a4968f61f 100644 --- a/bookwyrm/models/notification.py +++ b/bookwyrm/models/notification.py @@ -85,10 +85,13 @@ def notify_on_unfav(sender, instance, *args, **kwargs): ).delete() -@receiver(models.signals.post_save, sender=Status) +@receiver(models.signals.post_save) # pylint: disable=unused-argument def notify_user_on_mention(sender, instance, *args, **kwargs): """creating and deleting statuses with @ mentions and replies""" + if not issubclass(sender, Status): + return + if instance.deleted: Notification.objects.filter(related_status=instance).delete() return