feat: Automatically subscribe user that created AN to AN

This commit is contained in:
2024-12-14 13:24:51 +01:00
parent 44f05cbb7d
commit 9b824bc326
2 changed files with 17 additions and 9 deletions

View File

@@ -163,6 +163,9 @@ class User(AbstractUser):
def get_notifications_url(self):
return self.get_absolute_url()
def get_unread_notifications(self):
return BaseNotification.objects.filter(user=self, read=False)
def get_num_unread_notifications(self):
return BaseNotification.objects.filter(user=self, read=False).count()