Skip to content

Commit e1a2fc2

Browse files
authored
feat: Ensure shipping is locked if cart is frozen (viur-framework#131)
1 parent 5b30f0f commit e1a2fc2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/viur/shop/skeletons/cart.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ def unserialize_compute(self, skel: "SkeletonInstance", name: str) -> bool:
152152
# FIXME: Ensure it's a valid shipping for the cart
153153
return False
154154

155+
if skel["is_frozen"]: # locked, unserialize the latest stored value from entity
156+
return False
157+
155158
if skel["shipping_status"] == ShippingStatus.CHEAPEST: # compute cheapest
156-
# TODO: if not locked ...
157159
self._prevent_compute = True
158160
try:
159161
applicable_shippings = SHOP_INSTANCE.get().shipping.get_shipping_skels_for_cart(

0 commit comments

Comments
 (0)