Commits

Kai Diefenbach committed 4c9df55

Cart: delete item if user enters amount of 0

Comments (0)

Files changed (1)

lfs/cart/views.py

         else:
             item.amount = int(float(amount))
 
-        item.save()
+        if int(amount) == 0:
+            item.delete()
+        else:
+            item.save()
 
     # IMPORTANT: We have to send the signal already here, because the valid
     # shipping methods might be dependent on the price.