Fix erreur 500 contact form

This commit is contained in:
Jean-Marie Favreau 2024-11-29 20:02:12 +01:00
parent e875ae626b
commit 1d9251946c

View File

@ -732,6 +732,10 @@ class ContactMessageCreateView(SuccessMessageMixin, CreateView):
success_url = reverse_lazy("home") success_url = reverse_lazy("home")
success_message = _("Your message has been sent successfully.") 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): def get_form(self, form_class=None):
if form_class is None: if form_class is None:
form_class = self.get_form_class() form_class = self.get_form_class()