Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix issues from latest commit
NyanKiyoshi251bd5f2fc12
diff --git a/saleor/checkout/views/summary.py b/saleor/checkout/views/summary.pyindex c900765289..dab7c4332c 100644--- a/saleor/checkout/views/summary.py+++ b/saleor/checkout/views/summary.py@@ -8,11 +8,10 @@ from ...core.exceptions import InsufficientStockfrom ...discount.models import NotApplicablefrom ..forms import CheckoutNoteFormfrom ..utils import (- get_checkout_context, get_taxes_for_checkout,+ get_checkout_context, get_taxes_for_checkout, place_checkout_to_order,update_billing_address_in_anonymous_checkout,update_billing_address_in_checkout,- update_billing_address_in_checkout_with_shipping,- place_checkout_to_order)+ update_billing_address_in_checkout_with_shipping)def handle_order_placement(request, checkout):diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.pyindex 666b7e4e7b..ac6876c8f1 100644--- a/saleor/dashboard/order/views.py+++ b/saleor/dashboard/order/views.py@@ -170,8 +170,9 @@ def capture_payment(request, order_pk, payment_pk):msg = pgettext_lazy('Dashboard message related to a payment','Captured %(amount)s') % {'amount': prices_i18n.amount(amount)}- OrderEvent.objects.bulk_create([OrderEvent.payment_captured_event(- order=order, source=request.user, amount=amount, payment=payment)])+ OrderEvent.payment_captured_event(+ order=order, source=request.user,+ amount=amount, payment=payment).save()messages.success(request, msg)return redirect('dashboard:order-details', order_pk=order.pk)status = 400 if form.errors else 200@@ -534,9 +535,8 @@ def mark_order_as_paid(request, order_pk):if form.is_valid():with transaction.atomic():form.save()- OrderEvent.objects.bulk_create([- OrderEvent.manually_marked_as_paid_event(- order=order, source=request.user)])+ OrderEvent.manually_marked_as_paid_event(+ order=order, source=request.user).save()msg = pgettext_lazy('Dashboard message','Order manually marked as paid')diff --git a/saleor/events/models/OrderEvent.py b/saleor/events/models/OrderEvent.pyindex 283ee06805..483bd2357a 100644--- a/saleor/events/models/OrderEvent.py+++ b/saleor/events/models/OrderEvent.py@@ -1,4 +1,4 @@-from typing import List, Union, Dict+from typing import Dict, List, Unionfrom django.conf import settingsfrom django.contrib.auth.base_user import AbstractBaseUser@@ -7,7 +7,7 @@ from django.db import modelsfrom django.utils.timezone import nowfrom prices import Money-from saleor.account.models import Address+from ...account.models import Addressfrom ...core.utils.json_serializer import CustomJsonEncoderfrom ...order.models import Fulfillment, Order, OrderLinefrom ...payment.models import Paymentdiff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.pyindex 4b7343262a..e527b77205 100644--- a/saleor/graphql/order/mutations/orders.py+++ b/saleor/graphql/order/mutations/orders.py@@ -1,9 +1,9 @@import graphenefrom django.core.exceptions import ValidationError-from ....events import models as event_modelsfrom ....account.models import Userfrom ....core.utils.taxes import ZERO_TAXED_MONEY+from ....events import models as event_modelsfrom ....order import modelsfrom ....order.utils import cancel_orderfrom ....payment import CustomPaymentChoices, PaymentErrordiff --git a/saleor/order/utils.py b/saleor/order/utils.pyindex e5e69e603c..9fba5262b5 100644--- a/saleor/order/utils.py+++ b/saleor/order/utils.py@@ -5,7 +5,6 @@ from django.db import transactionfrom django.shortcuts import get_object_or_404, redirectfrom prices import Money, TaxedMoney-from ..events.models import OrderEventfrom ..account.utils import store_user_addressfrom ..checkout import AddressTypefrom ..core.utils.taxes import (@@ -13,6 +12,7 @@ from ..core.utils.taxes import (from ..core.weight import zero_weightfrom ..dashboard.order.utils import get_voucher_discount_for_orderfrom ..discount.models import NotApplicable+from ..events.models import OrderEventfrom ..order import FulfillmentStatus, OrderStatus, emailsfrom ..order.models import Fulfillment, FulfillmentLine, Order, OrderLinefrom ..payment import ChargeStatusdiff --git a/saleor/payment/utils.py b/saleor/payment/utils.pyindex 024e8d598c..81f1e32c5f 100644--- a/saleor/payment/utils.py+++ b/saleor/payment/utils.py@@ -9,10 +9,10 @@ from django.core.serializers.json import DjangoJSONEncoderfrom django.db import transactionfrom django.utils.translation import pgettext_lazy-from ..events.models import OrderEventfrom ..account.models import Address, Userfrom ..checkout.models import Checkoutfrom ..core import analytics+from ..events.models import OrderEventfrom ..events.types import OrderEvents, OrderEventsEmailsfrom ..order import utils as order_utilsfrom ..order.emails import send_payment_confirmation