Permalink
Browse files

Change the way removing items from cart works, it makes more sense to…

… just feed the remove method the item in the cart rather than have it figure out what the generic relationship to the product is
  • Loading branch information...
1 parent b6a8d22 commit 1b4d21134cc15c4b3cf5c5ab27c142fc9672003d Alex Cabrera committed Jul 28, 2010
Showing with 2 additions and 5 deletions.
  1. +2 −5 cart/cart.py
View
@@ -44,12 +44,9 @@ def add(self, product, unit_price, quantity=1):
else:
raise ItemAlreadyExists
- def remove(self, product):
+ def remove(self, item):
try:
- item = models.Item.objects.get(
- cart=self.cart,
- product=product,
- )
+ item = models.Item.objects.get(pk=item.pk)
except models.Item.DoesNotExist:
raise ItemDoesNotExist
else:

0 comments on commit 1b4d211

Please sign in to comment.