feat: add basic subscriptions + emit notification for comment
This commit is contained in:
@@ -185,6 +185,9 @@ class AdoptionNotice(models.Model):
|
||||
def get_report_url(self):
|
||||
return reverse('report-adoption-notice', args=[str(self.id)])
|
||||
|
||||
def get_subscriptions(self):
|
||||
return Subscriptions.objects.filter(adoption_notice=self)
|
||||
|
||||
def get_photos(self):
|
||||
"""
|
||||
First trys to get group photos that are attached to the adoption notice if there is none it trys to fetch
|
||||
@@ -557,4 +560,4 @@ class CommentNotification(BaseNotification):
|
||||
class Subscriptions(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name=_('Nutzer*in'))
|
||||
adoption_notice = models.ForeignKey(AdoptionNotice, on_delete=models.CASCADE, verbose_name=_('AdoptionNotice'))
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
Reference in New Issue
Block a user