From d3f01832fefa792fd451cfbcd8efb17542024b98 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 27 May 2019 18:26:56 +0200 Subject: [PATCH] Fix a bug during validation --- src/pretix/base/forms/questions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/forms/questions.py b/src/pretix/base/forms/questions.py index f7715096a6..919b78b513 100644 --- a/src/pretix/base/forms/questions.py +++ b/src/pretix/base/forms/questions.py @@ -424,7 +424,9 @@ class BaseInvoiceAddressForm(forms.ModelForm): self.instance.name_parts = data.get('name_parts') - if all(not v for k, v in data.items() if k not in ('is_business', 'country', 'name_parts')) and len(data['name_parts']) == 1: + if all( + not v for k, v in data.items() if k not in ('is_business', 'country', 'name_parts') + ) and len(data.get('name_parts', {})) == 1: # Do not save the country if it is the only field set -- we don't know the user even checked it! self.cleaned_data['country'] = ''