diff --git a/www/conservancy/apps/assignment/forms.py b/www/conservancy/apps/assignment/forms.py index 83876d47b876221a8cb7a4c8061d9bbd2405192a..f69333555d79197f67825a8e2372b6f88da851da 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')