From: Jan Szejko Date: Tue, 19 Jul 2016 08:15:25 +0000 (+0200) Subject: fix speaker form X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/dd4be125f26f7bed47c7b6287ca2681108be683c?ds=inline fix speaker form --- diff --git a/prawokultury/contact_forms.py b/prawokultury/contact_forms.py index b47bd4b..11dfdcc 100644 --- a/prawokultury/contact_forms.py +++ b/prawokultury/contact_forms.py @@ -156,9 +156,9 @@ class RegisterSpeaker(RegistrationForm): def clean(self): cleaned_data = super(RegisterSpeaker, self).clean() errors = [] - if not cleaned_data['bio'] and not cleaned_data['bio_en']: + if not cleaned_data.get('bio') and not cleaned_data.get('bio_en'): errors.append(forms.ValidationError(_('Fill at least one bio!'))) - if not cleaned_data['presentation_title'] and not cleaned_data['presentation_title_en']: + if not cleaned_data.get('presentation_title') and not cleaned_data.get('presentation_title_en'): errors.append(forms.ValidationError(_('Fill at least one title!'))) if errors: raise forms.ValidationError(errors)