Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix query. (#15403)
Piotr Zabieglik4e23ac31a9a8
diff --git a/saleor/discount/utils.py b/saleor/discount/utils.pyindex ee03b29a4e..61658d95ac 100644--- a/saleor/discount/utils.py+++ b/saleor/discount/utils.py@@ -738,7 +738,7 @@ def _get_available_for_purchase_variant_ids(available_for_purchase_at__lte=today,channel_id=channel.id,)- available_variant_ids = ProductVariant.objects.filter(+ available_variant_ids = variants.filter(Exists(product_listings.filter(product_id=OuterRef("product_id")))).values_list("id", flat=True)return set(available_variant_ids)