prevent errors when deleting a product not in cart

This commit is contained in:
Russell Ballestrini 2024-12-06 17:11:13 -05:00
parent ae5543a072
commit 1f0a91ba5c

View file

@ -122,7 +122,8 @@ class Cart(RBase, Base):
def remove_product(self, product):
tmp_cart = self.cart
del tmp_cart[product.uuid_str]
if product.uuid_str in tmp_cart:
del tmp_cart[product.uuid_str]
self.cart = tmp_cart
def set_product_quantity(self, product, quantity):