let create_transactions() handle all the mailing

This commit is contained in:
Lukas Bockstaller
2026-03-09 18:06:04 +01:00
parent 4602db2bff
commit b5cf122a2a
3 changed files with 3 additions and 3 deletions

View File

@@ -1819,7 +1819,7 @@ class OrderCreateSerializer(I18nAwareModelSerializer):
},
state=OrderPayment.PAYMENT_STATE_CREATED
)
gift_card_payment_provider.execute_payment(request=None, payment=payment, is_early_special_case=not self._send_mail)
gift_card_payment_provider.execute_payment(request=None, payment=payment, is_early_special_case=True)
if order.pending_sum <= Decimal('0.00'):
order.status = Order.STATUS_PAID

View File

@@ -1657,7 +1657,7 @@ class GiftCardPayment(BasePaymentProvider):
}
)
except PaymentException as e:
payment.fail(info={'error': str(e)})
payment.fail(info={'error': str(e)}, send_mail=not is_early_special_case)
raise e
def payment_is_valid_session(self, request: HttpRequest) -> bool:

View File

@@ -3420,7 +3420,7 @@ def test_order_create_use_gift_cards_only_pending(token_client, organizer, event
False, 0
),
(
True, 2 # TODO check why we get 3 mails, one order receivend and two payments
True, 2
),
],
)