You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, an empty tag {% thumbnail %} does not give an error (as omitting the geometry string does). I checked this with THUMBNAIL_DEBUG = True.
One time when the error surfaces is when running django-compressor's ./manage.py compress. This results in an IndexError list index out of range from sorl/thumbnail/templatetags/thumbnail.py in __init__ at line 96:
Turns out that i hadn't been paying attention while copy/pasting a lot of thumbnail tags, and instead of {% endthumbnail %} i'd put {% thumbnail %}.
I think it would be better if sorl.thumbnail raises an exception on empty template thumbnail tags, especially if THUMBNAIL_DEBUG = True, because empty tags do nothing and can only be an error.
The text was updated successfully, but these errors were encountered:
According to https://sorl-thumbnail.readthedocs.io/en/latest/examples.html#template-examples, a thumbnail template tag requires at least an image argument and a geometry string:
{% thumbnail item.image "100x100" %}
However, an empty tag
{% thumbnail %}
does not give an error (as omitting the geometry string does). I checked this withTHUMBNAIL_DEBUG = True
.One time when the error surfaces is when running django-compressor's
./manage.py compress
. This results in anIndexError list index out of range
fromsorl/thumbnail/templatetags/thumbnail.py
in__init__
at line 96:Turns out that i hadn't been paying attention while copy/pasting a lot of thumbnail tags, and instead of
{% endthumbnail %}
i'd put{% thumbnail %}
.I think it would be better if sorl.thumbnail raises an exception on empty template thumbnail tags, especially if
THUMBNAIL_DEBUG = True
, because empty tags do nothing and can only be an error.The text was updated successfully, but these errors were encountered: