From 88eef14f0c0353b5b1c56bf8cf32c47a9e0fa1a0 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 18 Nov 2022 15:30:05 +0100 Subject: [PATCH] fix --- src/catalogue/templatetags/catalogue_tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/catalogue/templatetags/catalogue_tags.py b/src/catalogue/templatetags/catalogue_tags.py index 2ca0a2d37..7189e9523 100644 --- a/src/catalogue/templatetags/catalogue_tags.py +++ b/src/catalogue/templatetags/catalogue_tags.py @@ -535,7 +535,7 @@ def content_warning(book): @register.inclusion_tag('catalogue/preview_ad.html', takes_context=True) def preview_ad(context): - book = Book.objects.filter(preview=True).first() + book = Book.objects.filter(parent=None, preview=True).first() return { 'accessible': book.is_accessible_to(context['request'].user), 'book': book, @@ -543,7 +543,7 @@ def preview_ad(context): @register.inclusion_tag('catalogue/preview_ad_homepage.html', takes_context=True) def preview_ad_homepage(context): - book = Book.objects.filter(preview=True).first() + book = Book.objects.filter(parent=None, preview=True).first() return { 'accessible': book.is_accessible_to(context['request'].user), 'book': book, -- 2.20.1