cart remove_item does not save the cartitem

Create issue
Issue #1243 resolved
Vaz Allen created an issue

This is an issue with Cart.remove_item

If a cartitem has a quantity of, say, 5, and you remove all 5, it works fine, because it calls cartitem.delete(). But, if you only remove 3, nothing happens, because the method is saving the Cart (self.save()) instead of saving the cartitem.

Here's the patch: {{{ #!diff

diff -r a8a2e5f51654 satchmo/apps/satchmo_store/shop/models.py --- a/satchmo/apps/satchmo_store/shop/models.py Thu Nov 04 15:34:53 2010 -0400 +++ b/satchmo/apps/satchmo_store/shop/models.py Wed Dec 15 08:21:13 2010 -0500 @@ -382,8 +382,8 @@ item_to_modify.quantity -= number_removed if item_to_modify.quantity <= 0: item_to_modify.delete() - self.save() - + else: + item_to_modify.save()

 def merge_carts(self, src_cart):
     """

}}}

Comments (2)

  1. Log in to comment