Skip to content

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

Specify update_fields

Pacu2c4a6853e52a0
diff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.py
index a8c0baf277..e907748b74 100644
--- a/saleor/graphql/order/mutations/orders.py
+++ b/saleor/graphql/order/mutations/orders.py
@@ -156,7 +156,10 @@ class OrderUpdateShipping(BaseMutation):
order.shipping_method = None
order.shipping_price = ZERO_TAXED_MONEY
order.shipping_method_name = None
- order.save()
+ order.save(
+ update_fields=[
+ 'shipping_method', 'shipping_price',
+ 'shipping_method_name'])
return OrderUpdateShipping(order=order)
method = cls.get_node_or_error(
@@ -169,7 +172,9 @@ class OrderUpdateShipping(BaseMutation):
order.shipping_method = method
order.shipping_price = method.get_total_price(info.context.taxes)
order.shipping_method_name = method.name
- order.save()
+ order.save(
+ update_fields=[
+ 'shipping_method', 'shipping_price', 'shipping_method_name'])
return OrderUpdateShipping(order=order)
order = graphene.Field(