From 9c9edff4f709baa15630a074a5a5db6e6c8a93c2 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sun, 3 Jun 2018 17:20:45 +0200 Subject: [PATCH] check for empty duration when cleaning duration field --- src/program/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/program/forms.py b/src/program/forms.py index e13d28be..e5d8af16 100644 --- a/src/program/forms.py +++ b/src/program/forms.py @@ -29,7 +29,7 @@ class BaseEventProposalForm(forms.ModelForm): def clean_duration(self): duration = self.cleaned_data['duration'] - if duration < 60 or duration > 180: + if not duration or duration < 60 or duration > 180: raise forms.ValidationError("Please keep duration between 60 and 180 minutes.") return duration