Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove useless item argument
Artur Smęt5156f8c12090
diff --git a/saleor/product/models/base.py b/saleor/product/models/base.pyindex f3d106767c..8d28c5ddc5 100644--- a/saleor/product/models/base.py+++ b/saleor/product/models/base.py@@ -118,7 +118,7 @@ class Product(models.Model, ItemRange):def get_slug(self):return slugify(smart_text(unidecode(self.name)))- def get_price_per_item(self, item, discounts=None, **kwargs):+ def get_price_per_item(self, discounts=None, **kwargs):price = self.priceif price and discounts:discounts = list(get_product_discounts(self, discounts, **kwargs))diff --git a/saleor/product/models/discounts.py b/saleor/product/models/discounts.pyindex a1abf780be..c23c7cf945 100644--- a/saleor/product/models/discounts.py+++ b/saleor/product/models/discounts.py@@ -34,10 +34,9 @@ class FixedProductDiscount(models.Model):from ...product.models import ProductVariantif isinstance(variant, ProductVariant):pk = variant.product.pk- check_price = variant.get_price_per_item()else:pk = variant.pk- check_price = variant.get_price_per_item(variant)+ check_price = variant.get_price_per_item()if not self.products.filter(pk=pk).exists():raise NotApplicable('Discount not applicable for this product')if self.discount > check_price: