Skip to content

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

Adjust other mutations to changes in BaseMutation

Marcin Gębala44ff39dcf95d
diff --git a/saleor/graphql/order/mutations/draft_orders.py b/saleor/graphql/order/mutations/draft_orders.py
index 9939b04866..03b331ec76 100644
--- a/saleor/graphql/order/mutations/draft_orders.py
+++ b/saleor/graphql/order/mutations/draft_orders.py
@@ -94,7 +94,7 @@ class DraftOrderCreate(ModelMutation):
if lines:
variant_ids = [line.get('variant_id') for line in lines]
variants = cls.get_nodes_or_error(
- ids=variant_ids, graphene_type=ProductVariant, errors=errors,
+ ids=variant_ids, only_type=ProductVariant, errors=errors,
field='variants')
quantities = [line.get('quantity') for line in lines]
line_errors = check_lines_quantity(variants, quantities)
diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.py
index 2fbf50be9a..70659cbe68 100644
--- a/saleor/graphql/order/mutations/fulfillments.py
+++ b/saleor/graphql/order/mutations/fulfillments.py
@@ -171,12 +171,10 @@ class FulfillmentCancel(BaseMutation):
order = fulfillment.order
errors = []
if not fulfillment.can_edit():
- errors.append(
- Error(
- field='fulfillment',
- message=pgettext_lazy(
- 'Cancel fulfillment mutation error',
- 'This fulfillment can\'t be canceled')))
+ err_msg = pgettext_lazy(
+ 'Cancel fulfillment mutation error',
+ 'This fulfillment can\'t be canceled')
+ cls.add_error(errors, 'fulfillment', err_msg)
if errors:
return cls(errors=errors)
cancel_fulfillment(fulfillment, restock)