prevent errors when deleting a product not in cart
This commit is contained in:
parent
ae5543a072
commit
1f0a91ba5c
1 changed files with 2 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue