Skip to content

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

Allow defining value for attribute value for all attribute types (#8210)

Iga Karbowiakb97b53087dd7
diff --git a/saleor/graphql/attribute/mutations.py b/saleor/graphql/attribute/mutations.py
index a2715ea76d..7a1bbfb1c0 100644
--- a/saleor/graphql/attribute/mutations.py
+++ b/saleor/graphql/attribute/mutations.py
@@ -636,7 +636,7 @@ class AttributeValueCreate(AttributeMixin, ModelMutation):
input_type = instance.attribute.input_type
is_swatch_attr = input_type == AttributeInputType.SWATCH
- only_swatch_fields = ["file_url", "content_type", "value"]
+ only_swatch_fields = ["file_url", "content_type"]
errors = {}
if not is_swatch_attr:
for field in only_swatch_fields:
diff --git a/saleor/graphql/attribute/tests/mutations/test_attribute_value_create.py b/saleor/graphql/attribute/tests/mutations/test_attribute_value_create.py
index 654838ee30..b8cc498fbf 100644
--- a/saleor/graphql/attribute/tests/mutations/test_attribute_value_create.py
+++ b/saleor/graphql/attribute/tests/mutations/test_attribute_value_create.py
@@ -198,7 +198,6 @@ def test_create_swatch_attribute_value_with_value_and_file(
@pytest.mark.parametrize(
"field, value",
[
- ("value", "#ffffff"),
("fileUrl", "http://mirumee.com/test_media/test_file.jpeg"),
("contentType", "jpeg"),
],
diff --git a/saleor/graphql/attribute/tests/mutations/test_attribute_value_update.py b/saleor/graphql/attribute/tests/mutations/test_attribute_value_update.py
index d1458325e0..2243c3682a 100644
--- a/saleor/graphql/attribute/tests/mutations/test_attribute_value_update.py
+++ b/saleor/graphql/attribute/tests/mutations/test_attribute_value_update.py
@@ -190,7 +190,6 @@ def test_update_swatch_attribute_value_clear_file_value(
@pytest.mark.parametrize(
"field, input_value",
[
- ("value", "#ffffff"),
("fileUrl", "http://mirumee.com/test_media/test_file.jpeg"),
("contentType", "jpeg"),
],