diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index e31eeda..3ee603f 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -143,7 +143,12 @@ class EventFilter(django_filters.FilterSet): return [] def get_recurrence_filtering(self): if "recurrences" in self.form.cleaned_data: - return dict(self.RECURRENT_CHOICES)[self.form.cleaned_data["recurrences"]] + d = dict(self.RECURRENT_CHOICES) + v = self.form.cleaned_data["recurrences"] + if v in d: + return d[v] + else: + return "" else: return ""