Skip to content

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

Fix review remarks

fowczarek798e09e8b675
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py
index 88e5a3146c..9b4851f258 100644
--- a/saleor/graphql/product/mutations/products.py
+++ b/saleor/graphql/product/mutations/products.py
@@ -342,7 +342,7 @@ class ProductCreate(ModelMutation):
cls.add_error(errors, 'sku', 'This field cannot be blank.')
elif models.ProductVariant.objects.filter(sku=input_sku).exists():
cls.add_error(
- errors, 'sku', 'Product with this Sku already exists.')
+ errors, 'sku', 'Product with this SKU already exists.')
@classmethod
@transaction.atomic
@@ -384,10 +384,10 @@ class ProductUpdate(ProductCreate):
def clean_sku(cls, product_type, cleaned_input, errors):
input_sku = cleaned_input.get('sku')
if (not product_type.has_variants and
- input_sku and
- models.ProductVariant.objects.filter(sku=input_sku).exists()):
+ input_sku and
+ models.ProductVariant.objects.filter(sku=input_sku).exists()):
cls.add_error(
- errors, 'sku', 'Product with this Sku already exists.')
+ errors, 'sku', 'Product with this SKU already exists.')
@classmethod
@transaction.atomic
diff --git a/tests/api/test_product.py b/tests/api/test_product.py
index 358c53c666..915120a1e7 100644
--- a/tests/api/test_product.py
+++ b/tests/api/test_product.py
@@ -631,7 +631,7 @@ def test_create_product_without_variants_sku_duplication(
content = get_graphql_content(response)
data = content['data']['productCreate']
assert data['errors'][0]['field'] == 'sku'
- assert data['errors'][0]['message'] == 'Product with this Sku already exists.'
+ assert data['errors'][0]['message'] == 'Product with this SKU already exists.'
def test_update_product(
@@ -823,7 +823,7 @@ def test_update_product_without_variants_sku_duplication(
data = content['data']['productUpdate']
assert data['errors']
assert data['errors'][0]['field'] == 'sku'
- assert data['errors'][0]['message'] == 'Product with this Sku already exists.'
+ assert data['errors'][0]['message'] == 'Product with this SKU already exists.'
def test_delete_product(staff_api_client, product, permission_manage_products):
query = """