Skip to content

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

Optimize update_products_discounted_prices_of_catalogues_task (#10369)

Tomasz Szymańskid36796ecd83e
diff --git a/saleor/product/utils/variant_prices.py b/saleor/product/utils/variant_prices.py
index 7330d28269..d975698e31 100644
--- a/saleor/product/utils/variant_prices.py
+++ b/saleor/product/utils/variant_prices.py
@@ -68,7 +68,7 @@ def update_products_discounted_prices(products, discounts=None):
if discounts is None:
discounts = fetch_active_discounts()
- for product in products.prefetch_related("channel_listings"):
+ for product in products.prefetch_related("channel_listings", "collections"):
update_product_discounted_price(product, discounts)