mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Order change: Allow to ignore quotas
This commit is contained in:
@@ -177,6 +177,10 @@ class OtherOperationsForm(forms.Form):
|
||||
'Send an email to the customer notifying that their order has been changed.'
|
||||
)
|
||||
)
|
||||
ignore_quotas = forms.BooleanField(
|
||||
label=_('Allow to overbook quotas when performing this operation'),
|
||||
required=False,
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
kwargs.pop('order')
|
||||
|
||||
@@ -206,6 +206,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
{% bootstrap_field other_form.ignore_quotas layout="" %}
|
||||
</div>
|
||||
<div class="form-group submit-group">
|
||||
<a class="btn btn-default btn-lg"
|
||||
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||
|
||||
@@ -1259,7 +1259,7 @@ class OrderChange(OrderView):
|
||||
messages.error(self.request, _('An error occurred. Please see the details below.'))
|
||||
else:
|
||||
try:
|
||||
ocm.commit()
|
||||
ocm.commit(check_quotas=not self.other_form.cleaned_data['ignore_quotas'])
|
||||
except OrderError as e:
|
||||
messages.error(self.request, str(e))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user