Deduplicate notifications in notification model

This commit is contained in:
Mouse Reeve
2021-02-10 16:21:29 -08:00
parent d9e65aa363
commit e0cfb009e4
5 changed files with 16 additions and 12 deletions

View File

@ -26,11 +26,6 @@ class Favorite(ActivityMixin, BookWyrmModel):
if self.status.user.local and self.status.user != self.user:
notification_model = apps.get_model(
'bookwyrm.Notification', require_ready=True)
if notification_model.objects.filter(
user=self.status.user, related_user=self.user,
related_status=self.status, notification_type='FAVORITE'
).exists():
return
notification_model.objects.create(
user=self.status.user,
notification_type='FAVORITE',