feat:Add notification when AN is set unchecked
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
moanos [he/him] 2024-11-22 11:57:13 +01:00
parent dc3859d589
commit 8de5f162eb

View File

@ -367,6 +367,11 @@ class AdoptionNotice(models.Model):
self.adoptionnoticestatus.set_unchecked()
self.save()
for subscription in self.get_subscriptions():
notification_title = _("Vermittlung deaktiviert:") + f" {self}"
text = _("Die folgende Vermittlung wurde deaktiviert: ") + f"{self.name}, {self.get_absolute_url()}"
BaseNotification.objects.create(user=subscription.owner, text=text, title=notification_title)
class AdoptionNoticeStatus(models.Model):
"""