Only make notification count red for mentions

This commit is contained in:
Mouse Reeve
2021-04-30 07:49:34 -07:00
parent b4c155f134
commit 454dd25681
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"],
).exists()
activity_serializer = activitypub.Person
@classmethod