Skip to content

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

Fix bug where product variant can not have attributes with same slug

Unknown32f58fa6de60
diff --git a/saleor/product/models.py b/saleor/product/models.py
index faf273261d..ea73313f7a 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -344,7 +344,8 @@ class Attribute(models.Model):
return self.name
def get_formfield_name(self):
- return slugify('attribute-%s' % self.slug, allow_unicode=True)
+ return slugify(
+ 'attribute-%s-%s' % (self.slug, self.id), allow_unicode=True)
def has_values(self):
return self.values.exists()