Encompass all status models in notification signal

This commit is contained in:
Mouse Reeve 2021-09-22 11:10:37 -07:00
parent b7c2fb600a
commit 50ca3eef31

View file

@ -85,10 +85,13 @@ def notify_on_unfav(sender, instance, *args, **kwargs):
).delete() ).delete()
@receiver(models.signals.post_save, sender=Status) @receiver(models.signals.post_save)
# pylint: disable=unused-argument # pylint: disable=unused-argument
def notify_user_on_mention(sender, instance, *args, **kwargs): def notify_user_on_mention(sender, instance, *args, **kwargs):
"""creating and deleting statuses with @ mentions and replies""" """creating and deleting statuses with @ mentions and replies"""
if not issubclass(sender, Status):
return
if instance.deleted: if instance.deleted:
Notification.objects.filter(related_status=instance).delete() Notification.objects.filter(related_status=instance).delete()
return return