From f5ac7e3aa597bbe54426bab170ce3ca0a240362c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sun, 25 Sep 2022 14:58:40 +0200 Subject: [PATCH] =?UTF-8?q?Dom=C5=AF=20=3D>=20vypln=C4=9Bn=C3=A1=20adresa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/forms.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/personalni/forms.py b/personalni/forms.py index 72fb6b1a..b06581fc 100644 --- a/personalni/forms.py +++ b/personalni/forms.py @@ -105,6 +105,12 @@ class PrihlaskaForm(PasswordResetForm): pass return email + def clean_zasilat(self): + zasilat = self.cleaned_data.get('zasilat') + ulice = self.cleaned_data.get('ulice') + if zasilat == Resitel.ZASILAT_DOMU and ulice == "": + raise forms.ValidationError('Nevyplněná adresa bydliště, nelze zasílat čísla domů.') + return zasilat def clean(self): super().clean()