Skip to content

Commit

Permalink
Only create attributevalues that are dirty (#4250)
Browse files Browse the repository at this point in the history
  • Loading branch information
specialunderwear committed Feb 22, 2024
1 parent fee973c commit a361765
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/oscar/apps/catalogue/product_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ def prepare_save(self):
)

bound_value_obj = attribute.bind_value(new_value_obj, value)
if bound_value_obj is not None:
# don't create attributevalues that wheren't even set at all.
if bound_value_obj is not None and bound_value_obj.is_dirty:
assert not bound_value_obj.pk
to_be_created.append(bound_value_obj)
else:
Expand Down

0 comments on commit a361765

Please sign in to comment.