Don't try to cancel payment if provider plugin is disabled (PRETIXEU-754)

This commit is contained in:
Raphael Michel
2022-09-12 13:06:03 +02:00
parent 865bd126f3
commit db93981bac

View File

@@ -1210,7 +1210,8 @@ class OrderTransition(OrderView):
OrderPayment.PAYMENT_STATE_CREATED)):
try:
with transaction.atomic():
p.payment_provider.cancel_payment(p)
if p.payment_provider:
p.payment_provider.cancel_payment(p)
self.order.log_action('pretix.event.order.payment.canceled', {
'local_id': p.local_id,
'provider': p.provider,