Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
ORDER_CANCELED notification is fired at the end of transaction (#10242)
Michał Fijołekd9eecb2caa45
diff --git a/saleor/order/actions.py b/saleor/order/actions.pyindex 96ee6e3308..327153d4ea 100644--- a/saleor/order/actions.py+++ b/saleor/order/actions.py@@ -171,7 +171,9 @@ def cancel_order(transaction.on_commit(lambda: manager.order_cancelled(order))transaction.on_commit(lambda: manager.order_updated(order))- send_order_canceled_confirmation(order, user, app, manager)+ transaction.on_commit(+ lambda: send_order_canceled_confirmation(order, user, app, manager)+ )def order_refunded(diff --git a/saleor/order/tests/test_order_actions.py b/saleor/order/tests/test_order_actions.pyindex 1abde05fc2..713035c3c6 100644--- a/saleor/order/tests/test_order_actions.py+++ b/saleor/order/tests/test_order_actions.py@@ -10,6 +10,7 @@ from ...payment.models import Paymentfrom ...plugins.manager import get_plugins_managerfrom ...product.models import DigitalContentfrom ...product.tests.utils import create_image+from ...tests.utils import flush_post_commit_hooksfrom ...warehouse.models import Allocation, Stockfrom .. import FulfillmentStatus, OrderEvents, OrderStatusfrom ..actions import (@@ -236,6 +237,7 @@ def test_cancel_order(order_line__order=order, quantity_allocated__gt=0).exists()+ flush_post_commit_hooks()send_order_canceled_confirmation_mock.assert_called_once_with(order, None, None, manager)