Add-on selection: Fix incorrect pre-selection across multiple base positions

This commit is contained in:
Raphael Michel
2022-01-26 09:45:26 +01:00
parent 3be6e83f33
commit 194042dca5
3 changed files with 15 additions and 7 deletions

View File

@@ -513,7 +513,11 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
)
item_cache[ckey] = items
else:
items = item_cache[ckey]
# We can use the cache to prevent a database fetch, but we need separate Python objects
# or our things below like setting `i.initial` will do the wrong thing.
items = [copy.copy(i) for i in item_cache[ckey]]
for i in items:
i.available_variations = [copy.copy(v) for v in i.available_variations]
for i in items:
i.allow_waitinglist = False