Merge pull request #1020 from bookwyrm-social/notification-color

Only make notification count red for mentions
This commit is contained in:
Mouse Reeve
2021-04-30 13:49:57 -07:00
committed by GitHub
4 changed files with 22 additions and 3 deletions

View File

@ -150,6 +150,19 @@ class User(OrderedCollectionPageMixin, AbstractUser):
"""for consistent naming"""
return not self.is_active
@property
def unread_notification_count(self):
"""count of notifications, for the templates"""
return self.notification_set.filter(read=False).count()
@property
def has_unread_mentions(self):
"""whether any of the unread notifications are conversations"""
return self.notification_set.filter(
read=False,
notification_type__in=["REPLY", "MENTION", "TAG", "REPORT"],
).exists()
activity_serializer = activitypub.Person
@classmethod