From ef3eee7873ec85fa30f41dd53945de5571523e10 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 25 Sep 2017 09:38:35 +0200 Subject: [PATCH] ContactForm: Prevent TypeError during validation --- src/pretix/presale/forms/checkout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/presale/forms/checkout.py b/src/pretix/presale/forms/checkout.py index 2b5d87607a..ea51217f7b 100644 --- a/src/pretix/presale/forms/checkout.py +++ b/src/pretix/presale/forms/checkout.py @@ -49,7 +49,7 @@ class ContactForm(forms.Form): self.fields[key] = value def clean(self): - if self.event.settings.order_email_asked_twice: + if self.event.settings.order_email_asked_twice and self.cleaned_data.get('email') and self.cleaned_data.get('email_repeat'): if self.cleaned_data.get('email').lower() != self.cleaned_data.get('email_repeat').lower(): raise ValidationError(_('Please enter the same email address twice.'))