fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
94648e7
)
fix
author
Radek Czajka
<rczajka@rczajka.pl>
Thu, 9 Feb 2023 12:20:14 +0000
(13:20 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Thu, 9 Feb 2023 12:20:14 +0000
(13:20 +0100)
src/catalogue/templatetags/catalogue_tags.py
patch
|
blob
|
history
diff --git
a/src/catalogue/templatetags/catalogue_tags.py
b/src/catalogue/templatetags/catalogue_tags.py
index
b45fc50
..
57dd1f2
100644
(file)
--- a/
src/catalogue/templatetags/catalogue_tags.py
+++ b/
src/catalogue/templatetags/catalogue_tags.py
@@
-550,6
+550,8
@@
def content_warning(book):
@register.inclusion_tag('catalogue/preview_ad.html', takes_context=True)
def preview_ad(context):
book = Book.objects.filter(parent=None, preview=True).first()
@register.inclusion_tag('catalogue/preview_ad.html', takes_context=True)
def preview_ad(context):
book = Book.objects.filter(parent=None, preview=True).first()
+ if book is None:
+ return {}
return {
'accessible': book.is_accessible_to(context['request'].user),
'book': book,
return {
'accessible': book.is_accessible_to(context['request'].user),
'book': book,
@@
-558,6
+560,8
@@
def preview_ad(context):
@register.inclusion_tag('catalogue/preview_ad_homepage.html', takes_context=True)
def preview_ad_homepage(context):
book = Book.objects.filter(parent=None, preview=True).first()
@register.inclusion_tag('catalogue/preview_ad_homepage.html', takes_context=True)
def preview_ad_homepage(context):
book = Book.objects.filter(parent=None, preview=True).first()
+ if book is None:
+ return {}
return {
'accessible': book.is_accessible_to(context['request'].user),
'book': book,
return {
'accessible': book.is_accessible_to(context['request'].user),
'book': book,