From 7925ef91bde72911110e550fd1d760afbdaaaf75 Mon Sep 17 00:00:00 2001 From: Lars van de Kerkhof Date: Wed, 24 Jan 2024 14:19:24 +0100 Subject: [PATCH] Make sure to only return attributevalues that are on the actual product to avoid transferring attributesvalues from parent to child. --- oscarapi/serializers/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oscarapi/serializers/product.py b/oscarapi/serializers/product.py index 31094c94..06c11fd1 100644 --- a/oscarapi/serializers/product.py +++ b/oscarapi/serializers/product.py @@ -317,7 +317,7 @@ def update(self, instance, validated_data): # child product. product.attr._dirty.clear() # pylint: disable=protected-access product.attr.save() - return list(product.attr.get_values().filter(attribute__code__in=attr_codes)) + return list(product.attribute_values.filter(attribute__code__in=attr_codes)) class ProductAttributeValueSerializer(OscarModelSerializer):