From d4a4550d051c563099f89e491d60e3352b658816 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 17 Jan 2019 13:01:19 +0100 Subject: Fix display when no main image --- ishtar_common/models.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 73366e35a..8fb6df3ac 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1445,6 +1445,10 @@ class DocumentItem(object): def images_without_main_image(self): if not hasattr(self, 'main_image'): return self.images + if not self.main_image: + return self.documents.filter( + image__isnull=False).exclude( + image="").order_by("pk") return self.documents.filter( image__isnull=False).exclude( image="").exclude(pk=self.main_image.pk).order_by("pk") -- cgit v1.2.3