On n'affiche pas le message s'il est à false

See #263
This commit is contained in:
Jean-Marie Favreau 2025-01-16 23:41:38 +01:00
parent ba701e266a
commit 0ff5dbe917

View File

@ -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 <a href="{}">{}</a> has been moderated with success.').format(self.object.get_absolute_url(), self.object.title) + txt)