From 0a23aeece449375974cc12ed6b05350fc8d5aca0 Mon Sep 17 00:00:00 2001 From: Mira Date: Thu, 23 Jan 2025 12:59:39 +0100 Subject: [PATCH] Allow 0% tax rate on event creation (#4756) (but still warn if tax rate is not filled at all) --- src/pretix/control/forms/event.py | 2 +- src/pretix/control/views/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index 409456c7fc..98ba32d7af 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -231,7 +231,7 @@ class EventWizardBasicsForm(I18nModelForm): raise ValidationError({ 'timezone': _('Your default locale must be specified.') }) - if not data.get("no_taxes") and not data.get("tax_rate"): + if not data.get("no_taxes") and data.get("tax_rate") is None: raise ValidationError({ 'tax_rate': _('You have not specified a tax rate. If you do not want us to compute sales taxes, please ' 'check "{field}" above.').format(field=self.fields["no_taxes"].label) diff --git a/src/pretix/control/views/main.py b/src/pretix/control/views/main.py index 7e3e26ff24..cf414f5929 100644 --- a/src/pretix/control/views/main.py +++ b/src/pretix/control/views/main.py @@ -313,7 +313,7 @@ class EventWizard(SafeSessionWizardView): ) event.set_defaults() - if basics_data['tax_rate']: + if basics_data['tax_rate'] is not None: if not event.settings.tax_rate_default or event.settings.tax_rate_default.rate != basics_data['tax_rate']: event.settings.tax_rate_default = event.tax_rules.create( name=LazyI18nString.from_gettext(gettext('VAT')),