From eb383b976ed875888b261bf5901ee484aa2dcf8f Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 13 Jun 2023 23:36:43 +0200 Subject: [PATCH] fix --- src/catalogue/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 0bca7d814..95298897c 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -284,9 +284,12 @@ class TaggedObjectList(BookList): qs = Book.tagged.with_all(self.ctx['work_tags']).filter(findable=True) qs = qs.exclude(ancestor__in=qs) if self.is_themed: - qs = Fragment.tagged.with_all(self.ctx['fragment_tags']).filter( - Q(book__in=qs) | Q(book__ancestor__in=qs) - ) + fqs = Fragment.tagged.with_all(self.ctx['fragment_tags']) + if self.ctx['work_tags']: + fqs = fqs.filter( + Q(book__in=qs) | Q(book__ancestor__in=qs) + ) + qs = fqs return qs def get_suggested_tags(self, queryset): -- 2.20.1