From 8de5f162eb46a7737a779abfad635acd8458d24a Mon Sep 17 00:00:00 2001 From: moanos Date: Fri, 22 Nov 2024 11:57:13 +0100 Subject: [PATCH] feat:Add notification when AN is set unchecked --- src/fellchensammlung/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index a53e2e0..9bcce7a 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -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): """