Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove redundant function
akjanik8fca8d151bdb
diff --git a/saleor/checkout/views/summary.py b/saleor/checkout/views/summary.pyindex 1d3fc26012..0e450cb09f 100644--- a/saleor/checkout/views/summary.py+++ b/saleor/checkout/views/summary.py@@ -6,7 +6,7 @@ from django.utils.translation import pgettext, pgettext_lazyfrom ...account.forms import get_address_formfrom ...account.models import Addressfrom ...core.exceptions import InsufficientStock-from ...order.emails import order_send_confirmation+from ...order.emails import send_order_confirmationfrom ..forms import (AnonymousUserBillingForm, BillingAddressesForm,BillingWithoutShippingAddressForm, NoteForm)@@ -28,7 +28,7 @@ def create_order(checkout):order.history.create(user=user, content=pgettext_lazy('Order status history entry', 'Order was placed'))- order_send_confirmation(order.pk)+ send_order_confirmation.delay(order.pk)return order, redirect('order:payment', token=order.token)diff --git a/saleor/order/emails.py b/saleor/order/emails.pyindex f177588311..bc6bf06139 100644--- a/saleor/order/emails.py+++ b/saleor/order/emails.py@@ -54,7 +54,3 @@ def send_payment_confirmation(order_pk):def send_note_confirmation(order_pk):email_data = collect_data_for_email(order_pk, CONFIRM_NOTE_TEMPLATE)_send_confirmation(**email_data)---def order_send_confirmation(order_pk):- send_order_confirmation.delay(order_pk)diff --git a/saleor/order/signals.py b/saleor/order/signals.pyindex 43eac7626c..7926c58785 100644--- a/saleor/order/signals.py+++ b/saleor/order/signals.py@@ -3,7 +3,7 @@ import loggingfrom django.utils.translation import pgettext_lazyfrom ..core import analytics-from .emails import order_send_confirmation+from .emails import send_order_confirmationlogger = logging.getLogger(__name__)@@ -15,7 +15,7 @@ def order_status_change(sender, instance, **kwargs):order.history.create(content=pgettext_lazy('Order status history entry', 'Order fully paid'))- order_send_confirmation(order.pk)+ send_order_confirmation.delay(order.pk)try:analytics.report_order(order.tracking_client_id, order)except Exception:diff --git a/saleor/order/utils.py b/saleor/order/utils.pyindex 81e4add29b..0d11a6ef39 100644--- a/saleor/order/utils.py+++ b/saleor/order/utils.py@@ -210,4 +210,3 @@ def move_order_line_to_group(line, target_group, quantity):target_line.save()line.quantity -= quantityremove_empty_groups(line)-diff --git a/tests/test_checkout_integration.py b/tests/test_checkout_integration.pyindex 8e9975a97f..f1d4316be4 100644--- a/tests/test_checkout_integration.py+++ b/tests/test_checkout_integration.py@@ -8,7 +8,7 @@ from saleor.account.models import Userfrom .utils import get_redirect_location-@patch('saleor.checkout.views.summary.order_send_confirmation')+@patch('saleor.checkout.views.summary.send_order_confirmation')def test_checkout_flow(mock_send_confirmation, request_cart_with_item, client, shipping_method):# Enter checkout@@ -69,7 +69,7 @@ def test_checkout_flow(order_password = reverse('order:checkout-success', kwargs={'token': order.token})assert get_redirect_location(payment_response) == order_password- mock_send_confirmation.assert_called_once_with(order.pk)+ mock_send_confirmation.delay.assert_called_once_with(order.pk)def test_checkout_flow_authenticated_user(diff --git a/tests/test_order.py b/tests/test_order.pyindex 9000a2d895..2a6287b78c 100644--- a/tests/test_order.py+++ b/tests/test_order.py@@ -6,7 +6,7 @@ from prices import Pricefrom tests.utils import get_redirect_locationfrom saleor.order import OrderStatus, models-from saleor.order.emails import collect_data_for_email, order_send_confirmation+from saleor.order.emails import collect_data_for_emailfrom saleor.order.forms import OrderNoteFormfrom saleor.order.utils import add_variant_to_delivery_group@@ -189,10 +189,3 @@ def test_collect_data_for_email(order):order_url = reverse('order:details', kwargs={'token': order.token})assert order_url in email_data['url']assert email_data['email'] == order.user_email---@patch('saleor.order.emails.send_order_confirmation')-def test_order_send_confirmation(mocked_task_function, order):- pk = order.pk- order_send_confirmation(pk)- mocked_task_function.delay.assert_called_with(pk)