Skip to content

Commit 6ecdb8f

Browse files
authored
fix: Always allow removal of unlisted article from cart (#163)
Allow to remove an article from cart always, especially when its unlisted. See https://app.asana.com/1/1115626981204747/project/1202085386872001/task/1211803957680327 for details.
1 parent 60c2bb7 commit 6ecdb8f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/viur/shop/modules/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def article_update(
103103
parent_cart_key = self._normalize_external_key(
104104
parent_cart_key, "parent_cart_key")
105105
assert isinstance(quantity_mode, QuantityMode)
106-
if not self.shop.cart.get_article(article_key, parent_cart_key):
106+
if not self.shop.cart.get_article(article_key, parent_cart_key, must_be_listed=bool(quantity)):
107107
raise errors.NotFound(f"{parent_cart_key} has no article with {article_key=}")
108108
return JsonResponse(self.shop.cart.add_or_update_article(
109109
article_key=article_key,

0 commit comments

Comments
 (0)