1
0
Fork 0

Notification field is read, not unread

Oops
This commit is contained in:
Mouse Reeve 2022-07-04 21:32:35 -07:00
parent 801ba03aaf
commit 971bed9942
2 changed files with 4 additions and 4 deletions

View file

@ -61,7 +61,7 @@ class Notification(BookWyrmModel):
return
notification, _ = cls.objects.get_or_create(user=user, **kwargs)
notification.related_users.add(related_user)
notification.unread = True
notification.read = False
notification.save()
@classmethod
@ -72,7 +72,7 @@ class Notification(BookWyrmModel):
except Notification.DoesNotExist:
return
notification.related_users.remove(related_user)
if not notification.related_users.exists():
if not notification.related_users.count():
notification.delete()
@ -202,7 +202,7 @@ def notify_admins_on_report(sender, instance, *args, **kwargs):
notification, _ = Notification.objects.get_or_create(
user=admin,
notification_type=Notification.REPORT,
unread=True,
read=False,
)
notification.related_reports.add(instance)