saleor/graphql/product/mutations/products.py
def clean_sku(cls, product_type, cleaned_input, errors):
        """Validate SKU input field.

        When creating products that don't use variants, SKU is required in
        the input in order to create the default variant underneath.
        See the documentation for `has_variants` field for details:
        http://docs.getsaleor.com/en/latest/architecture/products.html#product-types
        """
        if not product_type.has_variants:
            input_sku = cleaned_input.get('sku')
            if not input_sku:
                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.')
Validate SKU input field.

        When creating products that don't use variants, SKU is required in
        the input in order to create the default variant underneath.
        See the documentation for `has_variants` field for details:
        http://docs.getsaleor.com/en/latest/architecture/products.html#product-types
        
Validate SKU input field.
When creating products that don't use variants, SKU is required in
the input in order to create the default variant underneath.
Validate SKU input field . When creating products that don ' t use variants SKU is required in the input in order to create the default variant underneath .
def clean_sku(cls, product_type, cleaned_input, errors):
        if not product_type.has_variants:
            input_sku = cleaned_input.get('sku')
            if not input_sku:
                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.')
def clean_sku ( cls , product_type , cleaned_input , errors ) : if not product_type . has_variants : input_sku = cleaned_input . get ( 'sku' ) if not input_sku : 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.' )
Validate SKU input field.
Validate SKU input field .
"""Validate SKU input field.

        When creating products that don't use variants, SKU is required in
        the input in order to create the default variant underneath.
        See the documentation for `has_variants` field for details:
        http://docs.getsaleor.com/en/latest/architecture/products.html#product-types
        """
cls
product_type
cleaned_input
errors