From 1d9251946c92e5c0c74b3294be8a194c4145bcc5 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Fri, 29 Nov 2024 20:02:12 +0100 Subject: [PATCH] Fix erreur 500 contact form --- src/agenda_culturel/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 2049ea6..fa162c5 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -732,6 +732,10 @@ class ContactMessageCreateView(SuccessMessageMixin, CreateView): success_url = reverse_lazy("home") success_message = _("Your message has been sent successfully.") + def __init__(self, *args, **kwargs): + self.event = None + super().__init__(*args, **kwargs) + def get_form(self, form_class=None): if form_class is None: form_class = self.get_form_class()