Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Always cast database ID to int in dataloader (#9340)

Marcin Gębala841f9a6ae96d
diff --git a/saleor/checkout/fetch.py b/saleor/checkout/fetch.py
index 17ed7e262f..924243e16b 100644
--- a/saleor/checkout/fetch.py
+++ b/saleor/checkout/fetch.py
@@ -134,7 +134,7 @@ class ShippingMethodInfo(DeliveryMethodBase):
@property
def delivery_method_order_field(self) -> dict:
if not self.delivery_method.is_external:
- return {"shipping_method_id": self.delivery_method.id}
+ return {"shipping_method_id": int(self.delivery_method.id)}
return {}
def is_valid_delivery_method(self) -> bool:
diff --git a/saleor/graphql/checkout/tests/test_checkout_complete.py b/saleor/graphql/checkout/tests/test_checkout_complete.py
index 5c843aa4e7..173c0cc1e9 100644
--- a/saleor/graphql/checkout/tests/test_checkout_complete.py
+++ b/saleor/graphql/checkout/tests/test_checkout_complete.py
@@ -33,11 +33,19 @@ MUTATION_CHECKOUT_COMPLETE = """
mutation checkoutComplete($token: UUID, $redirectUrl: String) {
checkoutComplete(token: $token, redirectUrl: $redirectUrl) {
order {
- id,
+ id
token
original
origin
- },
+ deliveryMethod {
+ ... on Warehouse {
+ id
+ }
+ ... on ShippingMethod {
+ id
+ }
+ }
+ }
errors {
field,
message,