diff --git a/www/conservancy/apps/assignment/forms.py b/www/conservancy/apps/assignment/forms.py index 8777e0b4857fc36018b98894832587f60447ed31..288dc75aa54bcfee7bf8e7da40aad497b97e6328 100644 --- a/www/conservancy/apps/assignment/forms.py +++ b/www/conservancy/apps/assignment/forms.py @@ -62,3 +62,6 @@ class AssignmentForm(forms.ModelForm): def clean_period_ends(self): 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') + + if self.cleaned_data['period_end_type'] == 'a specific past date' and not self.cleaned_data['period_ends']: + raise ValidationError('This field is required')