Skip to content

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

Typo

Krzysztof Świątekf703cadbfdca
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d28e5132b4..13f2bf1799 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -89,7 +89,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Remove unused settings and environment variables - #5420 by @maarcingebala
- Add product price validation - #5413 by @kswiatek92
- Add attribute validation to attributeAssign - #5423 by @kswiatek92
-- Check if image exists befeore validating - #5425 by @kswiatek92
+- Check if image exists before validating - #5425 by @kswiatek92
## 2.9.0
diff --git a/saleor/graphql/core/utils/__init__.py b/saleor/graphql/core/utils/__init__.py
index ad66639873..b6b7114a42 100644
--- a/saleor/graphql/core/utils/__init__.py
+++ b/saleor/graphql/core/utils/__init__.py
@@ -36,10 +36,9 @@ def str_to_enum(name):
def validate_image_file(file, field_name):
"""Validate if the file is an image."""
- print(type(file))
if not file:
raise ValidationError(
- {field_name: ValidationError("File is required", code="invalid")}
+ {field_name: ValidationError("File is required", code="required")}
)
if not file.content_type.startswith("image/"):
raise ValidationError(
diff --git a/tests/api/test_product.py b/tests/api/test_product.py
index aed2455477..a2a238e206 100644
--- a/tests/api/test_product.py
+++ b/tests/api/test_product.py
@@ -2543,7 +2543,7 @@ def test_product_image_create_mutation_without_file(
content = get_graphql_content(response)
errors = content["data"]["productImageCreate"]["productErrors"]
assert errors[0]["field"] == "image"
- assert errors[0]["code"] == ProductErrorCode.INVALID.name
+ assert errors[0]["code"] == ProductErrorCode.REQUIRED.name
def test_invalid_product_image_create_mutation(