From: Radek Czajka Date: Tue, 13 Jun 2023 21:36:43 +0000 (+0200) Subject: fix X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/eb383b976ed875888b261bf5901ee484aa2dcf8f?hp=243ac5a586da9e5abb87698306794b6cc173ded1 fix --- 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):