mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
Encompass all status models in notification signal
This commit is contained in:
parent
b7c2fb600a
commit
50ca3eef31
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue