Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Throw exception or return None in check_quantity

Michal Ociepkaa2c42da9b907
diff --git a/cart/__init__.py b/cart/__init__.py
index 094cf851d6..b3d16b11e5 100755
--- a/cart/__init__.py
+++ b/cart/__init__.py
@@ -126,9 +126,9 @@ class Cart(cart.Cart):
Raises exception when product has stock and user insert too big
quantity.
'''
+ super(Cart, self).check_quantity(product, quantity, data)
if isinstance(product, StockedProduct) and quantity > product.stock:
raise InsufficientStockException(product)
- return super(Cart, self).check_quantity(product, quantity, data)
def remove_cart_from_request(request):