From 0ff5dbe9178311f8013778ec250f38982e2fba53 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Thu, 16 Jan 2025 23:41:38 +0100 Subject: [PATCH] =?UTF-8?q?On=20n'affiche=20pas=20le=20message=20s'il=20es?= =?UTF-8?q?t=20=C3=A0=20false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #263 --- src/agenda_culturel/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 2da0733..1822fd0 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -324,7 +324,7 @@ class EventUpdateView( return kwargs def get_success_message(self, cleaned_data): - txt = _(" A message has been sent to the person who proposed the event.") if hasattr(self, "with_msg") else "" + txt = _(" A message has been sent to the person who proposed the event.") if hasattr(self, "with_msg") and self.with_msg else "" return mark_safe(_('The event has been successfully modified.') + txt) @@ -374,7 +374,7 @@ class EventModerateView( form_class = EventModerateForm def get_success_message(self, cleaned_data): - txt = _(" A message has been sent to the person who proposed the event.") if hasattr(self, "with_msg") else "" + txt = _(" A message has been sent to the person who proposed the event.") if hasattr(self, "with_msg") and self.with_msg else "" return mark_safe(_('The event {} has been moderated with success.').format(self.object.get_absolute_url(), self.object.title) + txt)