From 50f0336d87202ce628c9fb7e72625bfaa04a688d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20G=C3=B6ttsch?= Date: Fri, 4 Oct 2024 18:45:34 +0200 Subject: [PATCH] [FIX] devide between no open packages and no filter --- nfu_ecommerce/controllers/main.py | 2 +- nfu_ecommerce/models/product_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nfu_ecommerce/controllers/main.py b/nfu_ecommerce/controllers/main.py index 52dc815..bed77ec 100644 --- a/nfu_ecommerce/controllers/main.py +++ b/nfu_ecommerce/controllers/main.py @@ -48,6 +48,6 @@ class WebsiteSale(WebsiteSale): ) post["open_product_ids"] = open_product_ids else: - post["open_product_ids"] = [] + post["open_product_ids"] = None res = super().shop(page=0, category=None, search="", min_price=0.0, max_price=0.0, ppg=False, **post) return res diff --git a/nfu_ecommerce/models/product_template.py b/nfu_ecommerce/models/product_template.py index ab096e6..9ea29dc 100644 --- a/nfu_ecommerce/models/product_template.py +++ b/nfu_ecommerce/models/product_template.py @@ -16,6 +16,6 @@ class ProductTemplate(models.Model): search_details = super()._search_get_detail(website, order, options) open_product_ids = options.get("open_product_ids") domain = search_details["base_domain"] - if len(open_product_ids): + if open_product_ids is not None: domain.append([("id", "in", tuple(open_product_ids))]) return search_details