From fbef5db8cef4ee172405fdbe94cf0504ff599b7e Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Tue, 7 Dec 2021 17:49:57 +1100 Subject: [PATCH] Fix validation. --- www/conservancy/apps/assignment/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/conservancy/apps/assignment/forms.py b/www/conservancy/apps/assignment/forms.py index 83876d47..f6933355 100644 --- a/www/conservancy/apps/assignment/forms.py +++ b/www/conservancy/apps/assignment/forms.py @@ -54,5 +54,5 @@ class AssignmentForm(forms.ModelForm): ] def clean_period_ends(self): - if 'period_begins' in cleaned_data and 'period_ends' in cleaned_data and cleaned_data['period_begins'] > cleaned_data['period_ends']: + if 'period_begins' in self.cleaned_data and 'period_ends' in self.cleaned_data and self.cleaned_data['period_begins'] and self.cleaned_data['period_ends'] and self.cleaned_data['period_begins'] > self.cleaned_data['period_ends']: raise ValidationError('End of period is before start')