Skip to content

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

Refactor attribute error codes

Aleksander Spyra9d54634a7770
diff --git a/saleor/graphql/core/utils/error_codes.py b/saleor/graphql/core/utils/error_codes.py
index f939b8c86a..e6c50156ab 100644
--- a/saleor/graphql/core/utils/error_codes.py
+++ b/saleor/graphql/core/utils/error_codes.py
@@ -117,7 +117,6 @@ class AttributeErrorCode(Enum):
ATTRIBUTE_CANNOT_BE_ASSIGNED = "attribute_cannot_be_assigned"
ATTRIBUTE_DISABLED_VARIANTS = "attribute_disabled_variants"
ATTRIBUTE_NON_ASSIGNABLE = "attribute_non_assignable"
- ATTRIBUTE_SLUG_BLANK = "attribute_slug_blank"
ATTRIBUTE_VALUES_NOT_UNIQUE = "attribute_values_not_unique"
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index 20fc79e6ce..6907d61ad6 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -170,8 +170,7 @@ class AttributeMixin:
raise ValidationError(
{
"slug": ValidationError(
- "The attribute's slug cannot be blank.",
- code=AttributeErrorCode.ATTRIBUTE_SLUG_BLANK,
+ "The attribute's slug cannot be blank.", code="blank"
)
}
)
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index f69585a553..8f39150567 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -1393,7 +1393,6 @@ enum ErrorCode {
ATTRIBUTE_CANNOT_BE_ASSIGNED
ATTRIBUTE_DISABLED_VARIANTS
ATTRIBUTE_NON_ASSIGNABLE
- ATTRIBUTE_SLUG_BLANK
ATTRIBUTE_VALUES_NOT_UNIQUE
BILLING_ADDRESS_NOT_SET
BLANK