fix error

This commit is contained in:
Robert Einsle 2017-03-10 19:48:58 +01:00
parent 594fbe76c2
commit 57cf9553a2

View File

@ -13,7 +13,7 @@ class LocationAdminForm(forms.ModelForm):
raise ValidationError('Start und Ende Zeit muss angegeben werden')
if hh_start is not None and hh_end is None:
raise ValidationError('Start und Ende Zeit muss angegeben werden')
if not (hh_end > hh_start):
if hh_start is not None and hh_end is not None and not (hh_end > hh_start):
raise ValidationError('Ende-Zeit muss nach Start-Zeit liegen')
return self.cleaned_data['happy_hour_end']