mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Notification field is read, not unread
Oops
This commit is contained in:
parent
801ba03aaf
commit
971bed9942
2 changed files with 4 additions and 4 deletions
|
@ -69,7 +69,7 @@ def automod_task():
|
|||
with transaction.atomic():
|
||||
for admin in admins:
|
||||
notification, _ = notification_model.objects.get_or_create(
|
||||
user=admin, notification_type=notification_model.REPORT, unread=True
|
||||
user=admin, notification_type=notification_model.REPORT, read=False
|
||||
)
|
||||
notification.related_repors.add(reports)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue