From 9b4ea146b396d1096d052b3b2cffe72ef7585f0f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 24 Jul 2023 12:56:02 +0200 Subject: 🐛 Fix crash with no search counted (refs #5613) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/views_item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ishtar_common') diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index da1543e7b..70ae0f2d0 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -2183,7 +2183,7 @@ def get_item( items = items.distinct() try: - items_nb = items.values("pk").aggregate(Count("pk"))["pk__count"] + items_nb = items.values("pk").aggregate(Count("pk"))["pk__count"] or 0 except ProgrammingError: items_nb = 0 if count: -- cgit v1.2.3