Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove save method from AttributeValue
IKarbowiakd3d20317c076
diff --git a/saleor/product/models.py b/saleor/product/models.pyindex 088536d4b9..8be72ba614 100644--- a/saleor/product/models.py+++ b/saleor/product/models.py@@ -809,11 +809,6 @@ class AttributeValue(SortableModel):def get_ordering_queryset(self):return self.attribute.values.all()- def save(self, *args, **kwargs):- if not self.slug and self.name:- self.slug = slugify(self.name)- return super().save(*args, **kwargs)-class AttributeValueTranslation(models.Model):language_code = models.CharField(max_length=10)diff --git a/tests/test_product_attributes.py b/tests/test_product_attributes.pyindex 972bc4db38..d56d21947a 100644--- a/tests/test_product_attributes.py+++ b/tests/test_product_attributes.py@@ -1,7 +1,6 @@from unittest.mock import MagicMock, Mockimport pytest-from django.utils.text import slugifyfrom prices import Moneyfrom saleor.product import AttributeInputType@@ -29,11 +28,6 @@ def variant_with_no_attributes(category):return variant-def test_generate_slug_in_attribute_value_save(color_attribute):- value = AttributeValue.objects.create(attribute=color_attribute, name="Yellow")- assert value.slug == slugify("Yellow")--def test_generate_name_for_variant(variant_with_no_attributes, color_attribute_without_values, size_attribute):