Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add missing typing for order utils
IKarbowiakf604ebddc3bc
diff --git a/saleor/order/utils.py b/saleor/order/utils.pyindex 7078baf8ba..8d2fb14b94 100644--- a/saleor/order/utils.py+++ b/saleor/order/utils.py@@ -11,7 +11,7 @@ from ..account.utils import store_user_addressfrom ..checkout import AddressTypefrom ..core.taxes import zero_moneyfrom ..core.weight import zero_weight-from ..discount.models import NotApplicable, VoucherType+from ..discount.models import NotApplicable, Voucher, VoucherTypefrom ..discount.utils import get_products_voucher_discount, validate_voucher_in_orderfrom ..extensions.manager import get_extensions_managerfrom ..order import OrderStatus@@ -324,7 +324,7 @@ def get_valid_shipping_methods_for_order(order: Order):)-def get_products_voucher_discount_for_order(voucher):+def get_products_voucher_discount_for_order(voucher: Voucher) -> Money:"""Calculate products discount value for a voucher, depending on its type."""prices = Noneif not prices:@@ -335,7 +335,7 @@ def get_products_voucher_discount_for_order(voucher):return get_products_voucher_discount(voucher, prices)-def get_voucher_discount_for_order(order):+def get_voucher_discount_for_order(order: Order) -> Money:"""Calculate discount value depending on voucher and discount types.Raise NotApplicable if voucher of given type cannot be applied.