refonte de la boutique en ligne

This commit is contained in:
Thomas Girod 2022-10-31 16:15:16 +01:00
parent 8b09ba2924
commit c245ef7149

View File

@ -93,9 +93,10 @@ class Basket(models.Model):
except BasketItem.DoesNotExist: except BasketItem.DoesNotExist:
return return
item.quantity -= q item.quantity -= q
item.save()
if item.quantity <= 0: if item.quantity <= 0:
item.delete() item.delete()
else:
item.save()
def clear(self) -> None: def clear(self) -> None:
""" """