Skip to content

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

Fix attribute form

Krzysztof Wolskiacd3f2d55fb5
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.py
index 7b02ff8be1..421a52c192 100644
--- a/saleor/dashboard/product/forms.py
+++ b/saleor/dashboard/product/forms.py
@@ -276,7 +276,7 @@ class AttributeChoiceValueForm(forms.ModelForm):
def clean_display(self):
display = self.cleaned_data['display']
- if (not self.instance.pk and
+ if (not self.instance.pk and hasattr(self.instance, 'attribute') and
self.instance.attribute.values.filter(slug=slugify(display))):
raise forms.ValidationError(
pgettext_lazy(