From 45391b104a119bff6ecbfbf64418d1c6cfa1ab69 Mon Sep 17 00:00:00 2001 From: Mira Weller Date: Fri, 29 Nov 2024 14:15:36 +0100 Subject: [PATCH] Require at least one of street, zipcode, city if invoice_address_required --- src/pretix/base/forms/questions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pretix/base/forms/questions.py b/src/pretix/base/forms/questions.py index 6fbe9b77d..e7402d8cb 100644 --- a/src/pretix/base/forms/questions.py +++ b/src/pretix/base/forms/questions.py @@ -1153,6 +1153,8 @@ class BaseInvoiceAddressForm(forms.ModelForm): raise ValidationError({"company": _('You need to provide a company name.')}) if not data.get('is_business') and not data.get('name_parts'): raise ValidationError(_('You need to provide your name.')) + if not data.get('street') and not data.get('zipcode') and not data.get('city'): + raise ValidationError({"street": _('This field is required.')}) if 'vat_id' in self.changed_data or not data.get('vat_id'): self.instance.vat_id_validated = False