mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-20 15:17:06 +00:00
Fixes error in text trimming tag
This commit is contained in:
parent
76a4f0e9a7
commit
fdaa63d5dc
1 changed files with 3 additions and 1 deletions
|
@ -115,8 +115,10 @@ def get_book_description(book):
|
|||
@register.filter(name='text_overflow')
|
||||
def text_overflow(text):
|
||||
''' dont' let book descriptions run for ages '''
|
||||
if not text:
|
||||
return
|
||||
char_max = 500
|
||||
if len(text) < char_max:
|
||||
if text and len(text) < char_max:
|
||||
return text
|
||||
|
||||
trimmed = text[:char_max]
|
||||
|
|
Loading…
Reference in a new issue