forked from CGM_Public/pretix_original
Event creation: Prevent accidentally creating events without tax rate (#4623)
* Event creation: Prevent accidentally creating events without tax rate * Update src/pretix/control/forms/event.py Co-authored-by: Richard Schreiber <schreiber@rami.io> * Fix tests --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -136,6 +136,11 @@ class EventWizardBasicsForm(I18nModelForm):
|
||||
choices=settings.LANGUAGES,
|
||||
label=_("Default language"),
|
||||
)
|
||||
no_taxes = forms.BooleanField(
|
||||
label=_("I don't want to specify taxes now"),
|
||||
help_text=_("You can always configure tax rates later."),
|
||||
required=False,
|
||||
)
|
||||
tax_rate = forms.DecimalField(
|
||||
label=_("Sales tax rate"),
|
||||
help_text=_("Do you need to pay sales tax on your tickets? In this case, please enter the applicable tax rate "
|
||||
@@ -223,6 +228,11 @@ class EventWizardBasicsForm(I18nModelForm):
|
||||
raise ValidationError({
|
||||
'timezone': _('Your default locale must be specified.')
|
||||
})
|
||||
if not data.get("no_taxes") and not data.get("tax_rate"):
|
||||
raise ValidationError({
|
||||
'tax_rate': _('You have not specified a tax rate. If you do not want us to compute sales taxes, please '
|
||||
'check "Do not use taxes" above.')
|
||||
})
|
||||
|
||||
# change timezone
|
||||
zone = ZoneInfo(data.get('timezone'))
|
||||
|
||||
Reference in New Issue
Block a user