8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Fix form validation

This commit is contained in:
Hugo Levy-Falk 2019-09-28 12:38:57 +02:00 committed by chirac
parent b38521db69
commit 5c0a4ce748

View file

@ -300,6 +300,7 @@ class MandateForm(ModelForm):
def clean(self):
cleaned_data = super(MandateForm, self).clean()
start_date, end_date = cleaned_data['start_date'], cleaned_data['end_date']
if end_date:
included_mandates = Mandate.objects.filter(
Q(start_date__gte=start_date, start_date__lt=end_date)
| Q(end_date__gt=start_date, end_date__lte=end_date)