Skip to content

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

Drop handle_typed_errors from AttributeAssign and ShippingZoneMixin mutations

IKarbowiak98ff707f1986
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index 9bed71c771..72ae6737d1 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -382,20 +382,6 @@ class AttributeAssign(BaseMutation):
}
)
- @classmethod
- def handle_typed_errors(cls, errors: list, **extra):
- typed_errors = [
- cls._meta.error_type_class( # type: ignore
- field=e.field,
- message=e.message,
- code=code,
- attributes=params.get("attributes") if params else None,
- )
- for e, code, params in errors
- ]
- extra.update({cls._meta.error_type_field: typed_errors}) # type: ignore
- return cls(errors=[e[0] for e in errors], **extra) # type: ignore
-
@classmethod
def clean_operations(cls, product_type, product_attrs_pks, variant_attrs_pks):
"""Ensure the attributes are not already assigned to the product type."""
diff --git a/saleor/graphql/shipping/mutations.py b/saleor/graphql/shipping/mutations.py
index 2f9308ae69..6f3c220439 100644
--- a/saleor/graphql/shipping/mutations.py
+++ b/saleor/graphql/shipping/mutations.py
@@ -98,20 +98,6 @@ class ShippingZoneMixin:
cleaned_input["default"] = False
return cleaned_input
- @classmethod
- def handle_typed_errors(cls, errors: list, **extra):
- typed_errors = [
- cls._meta.error_type_class( # type: ignore
- field=e.field,
- message=e.message,
- code=code,
- warehouses=params.get("warehouses") if params else None,
- )
- for e, code, params in errors
- ]
- extra.update({cls._meta.error_type_field: typed_errors}) # type: ignore
- return cls(errors=[e[0] for e in errors], **extra) # type: ignore
-
@classmethod
@transaction.atomic
def _save_m2m(cls, info, instance, cleaned_data):