From 2a3cdd85e81e557b1f73af038c0b5fa19e789a08 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 3 Feb 2025 17:09:17 +0100 Subject: [PATCH] Prevent order changes that interfer with a pending payment that can't be aborted (Z#23179178) (#4765) --- src/pretix/presale/views/order.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pretix/presale/views/order.py b/src/pretix/presale/views/order.py index 1843ec3988..68396c0e21 100644 --- a/src/pretix/presale/views/order.py +++ b/src/pretix/presale/views/order.py @@ -1650,6 +1650,13 @@ class OrderChangeMixin: raise OrderError(_('You may not change your order in a way that increases the total price since ' 'payments are no longer being accepted for this event.')) + if ocm._totaldiff > Decimal('0.00') and self.order.status == Order.STATUS_PENDING: + for p in self.order.payments.filter(state=OrderPayment.PAYMENT_STATE_PENDING): + if not p.payment_provider.abort_pending_allowed: + raise OrderError(_('You may not change your order in a way that requires additional payment while ' + 'we are processing your current payment. Please check back after your current ' + 'payment has been accepted.')) + @method_decorator(xframe_options_exempt, 'dispatch') class OrderChange(OrderChangeMixin, EventViewMixin, OrderDetailMixin, TemplateView):