Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove check quantity method from ProductVariant model
Mira Szewczyk8db134a99cb1
diff --git a/saleor/product/models.py b/saleor/product/models.pyindex 1d15448e05..222821b9b2 100644--- a/saleor/product/models.py+++ b/saleor/product/models.py@@ -24,7 +24,6 @@ from text_unidecode import unidecodefrom versatileimagefield.fields import PPOIField, VersatileImageFieldfrom ..core.db.fields import SanitizedJSONField-from ..core.exceptions import InsufficientStockfrom ..core.models import (ModelWithMetadata,PublishableModel,@@ -480,14 +479,6 @@ class ProductVariant(ModelWithMetadata):def is_available(self) -> bool:return self.is_visible and self.is_in_stock()- def check_quantity(self, quantity):- """Check if there is at least the given quantity in stock.-- If stock handling is disabled, it simply run no check.- """- if self.track_inventory and quantity > self.quantity_available:- raise InsufficientStock(self)-@propertydef base_price(self) -> "Money":return (