From 57cf9553a2b5c152a56ef3d44f2803b5cce49662 Mon Sep 17 00:00:00 2001 From: Robert Einsle Date: Fri, 10 Mar 2017 19:48:58 +0100 Subject: [PATCH] fix error --- billard/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billard/admin.py b/billard/admin.py index ba4744f..2caca6d 100644 --- a/billard/admin.py +++ b/billard/admin.py @@ -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']