Skip to content

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

Update the additional assign to happen only for Product instances

Ania Warzechae0219c9adab5
diff --git a/saleor/attribute/utils.py b/saleor/attribute/utils.py
index a76c0360e1..2126eec278 100644
--- a/saleor/attribute/utils.py
+++ b/saleor/attribute/utils.py
@@ -46,9 +46,11 @@ def associate_attribute_values_to_instance(
# While migrating to a new structure we need to make sure we also
# copy the assigned product to AssignedProductAttributeValue
# where it will live after issue #12881 will be implemented
- AssignedProductAttributeValue.objects.filter(assignment_id=assignment.pk).update(
- product_id=instance.pk
- )
+ if isinstance(instance, Product):
+ AssignedProductAttributeValue.objects.filter(assignment_id=assignment.pk).update(
+ product_id=instance.pk
+ )
+
sort_assigned_attribute_values(instance, assignment, values)
return assignment