From 594803ec1798ace39d1e0742911f98075ff49ac0 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 28 May 2019 08:56:02 +0200 Subject: [PATCH] Make product.tax_rule required as soon as tax rules exist to avoid users from screwing up their taxes --- src/pretix/control/forms/item.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index 4968ea6407..9cd705ab95 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -206,6 +206,8 @@ class ItemCreateForm(I18nModelForm): empty_label=_('Do not copy'), required=False ) + if self.event.tax_rules.exists(): + self.fields['tax_rule'].required = True if not self.event.has_subevents: choices = [ @@ -364,6 +366,8 @@ class ItemUpdateForm(I18nModelForm): 'over 65. This ticket includes access to all parts of the event, except the VIP ' 'area.' ) + if self.event.tax_rules.exists(): + self.fields['tax_rule'].required = True self.fields['description'].widget.attrs['rows'] = '4' self.fields['sales_channels'] = forms.MultipleChoiceField( label=_('Sales channels'),