Changeset 1375
- Timestamp:
- 08/05/08 00:00:05 (4 months ago)
- Files:
-
- satchmo/trunk/satchmo/shop/models.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
satchmo/trunk/satchmo/shop/models.py
r1374 r1375 244 244 245 245 try: 246 item ToModify = self.cartitem_set.filter(product__id = chosen_item.id)[0]246 item_to_modify = self.cartitem_set.filter(product__id = chosen_item.id)[0] 247 247 # Custom Products will not be added, they will each get their own line item 248 248 #TODO: More sophisticated checks to make sure the options really are different 249 if 'CustomProduct' in item ToModify.product.get_subtypes():250 item ToModify = CartItem(cart=self, product=chosen_item, quantity=0)249 if 'CustomProduct' in item_to_modify.product.get_subtypes(): 250 item_to_modify = CartItem(cart=self, product=chosen_item, quantity=0) 251 251 needs_add = True 252 252 except IndexError: #It doesn't exist so create a new one 253 item ToModify = CartItem(cart=self, product=chosen_item, quantity=0)253 item_to_modify = CartItem(cart=self, product=chosen_item, quantity=0) 254 254 needs_add = True 255 255 … … 261 261 262 262 if needs_add: 263 self.cartitem_set.add(item ToModify)263 self.cartitem_set.add(item_to_modify) 264 264 265 265 item_to_modify.quantity += number_added
