forked from CGM_Public/pretix_original
Fix #1144 -- Make invoice form all-optional in backend
This commit is contained in:
@@ -146,6 +146,7 @@ class OrderQuestionsViewMixin(BaseQuestionsViewMixin):
|
||||
invoice_form_class = BaseInvoiceAddressForm
|
||||
invoice_name_form_class = BaseInvoiceNameForm
|
||||
only_user_visible = True
|
||||
all_optional = False
|
||||
|
||||
@cached_property
|
||||
def _positions_for_questions(self):
|
||||
@@ -189,12 +190,14 @@ class OrderQuestionsViewMixin(BaseQuestionsViewMixin):
|
||||
return self.invoice_name_form_class(
|
||||
data=self.request.POST if self.request.method == "POST" else None,
|
||||
event=self.request.event,
|
||||
instance=self.invoice_address, validate_vat_id=False
|
||||
instance=self.invoice_address, validate_vat_id=False,
|
||||
all_optional=self.all_optional
|
||||
)
|
||||
return self.invoice_form_class(
|
||||
data=self.request.POST if self.request.method == "POST" else None,
|
||||
event=self.request.event,
|
||||
instance=self.invoice_address, validate_vat_id=False
|
||||
instance=self.invoice_address, validate_vat_id=False,
|
||||
all_optional=self.all_optional,
|
||||
)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
||||
@@ -1255,6 +1255,7 @@ class OrderModifyInformation(OrderQuestionsViewMixin, OrderView):
|
||||
permission = 'can_change_orders'
|
||||
template_name = 'pretixcontrol/order/change_questions.html'
|
||||
only_user_visible = False
|
||||
all_optional = True
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
failed = not self.save() or not self.invoice_form.is_valid()
|
||||
|
||||
Reference in New Issue
Block a user