mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-04 23:36:32 +00:00
Merge branch 'main' into production
This commit is contained in:
commit
1d6f30c2df
1 changed files with 2 additions and 0 deletions
|
@ -56,6 +56,8 @@ def truncatepath(value, arg):
|
|||
@register.simple_tag(takes_context=False)
|
||||
def get_book_cover_thumbnail(book, size="medium", ext="jpg"):
|
||||
"""Returns a book thumbnail at the specified size and extension, with fallback if needed"""
|
||||
if size == "":
|
||||
size = "medium"
|
||||
try:
|
||||
cover_thumbnail = getattr(book, "cover_bw_book_%s_%s" % (size, ext))
|
||||
return cover_thumbnail.url
|
||||
|
|
Loading…
Reference in a new issue