Skip to content

Commit b10edca

Browse files
committed
fix: save cart instance before iterating
1 parent 1c0f0cd commit b10edca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cartridge/shop/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ def __iter__(self):
607607
ensuring the items are only retrieved once and cached.
608608
"""
609609
if not hasattr(self, "_cached_items"):
610+
self.save()
610611
self._cached_items = self.items.all()
611612
return iter(self._cached_items)
612613

0 commit comments

Comments
 (0)