mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Make product.tax_rule required as soon as tax rules exist to avoid users from screwing up their taxes
This commit is contained in:
@@ -206,6 +206,8 @@ class ItemCreateForm(I18nModelForm):
|
|||||||
empty_label=_('Do not copy'),
|
empty_label=_('Do not copy'),
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
if self.event.tax_rules.exists():
|
||||||
|
self.fields['tax_rule'].required = True
|
||||||
|
|
||||||
if not self.event.has_subevents:
|
if not self.event.has_subevents:
|
||||||
choices = [
|
choices = [
|
||||||
@@ -364,6 +366,8 @@ class ItemUpdateForm(I18nModelForm):
|
|||||||
'over 65. This ticket includes access to all parts of the event, except the VIP '
|
'over 65. This ticket includes access to all parts of the event, except the VIP '
|
||||||
'area.'
|
'area.'
|
||||||
)
|
)
|
||||||
|
if self.event.tax_rules.exists():
|
||||||
|
self.fields['tax_rule'].required = True
|
||||||
self.fields['description'].widget.attrs['rows'] = '4'
|
self.fields['description'].widget.attrs['rows'] = '4'
|
||||||
self.fields['sales_channels'] = forms.MultipleChoiceField(
|
self.fields['sales_channels'] = forms.MultipleChoiceField(
|
||||||
label=_('Sales channels'),
|
label=_('Sales channels'),
|
||||||
|
|||||||
Reference in New Issue
Block a user