summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauréline Guérin <zebuline@entrouvert.com>2019-10-14 13:02:24 (GMT)
committerLauréline Guérin <zebuline@entrouvert.com>2019-10-14 13:02:24 (GMT)
commit457c40d612b3735168fdb26345faf0eab467041d (patch)
treee733fdbc004980697db0fe14aeefda94d758b636
parent08a739e0d8c3aba7ae02c4b9e99ec03ab91f9b16 (diff)
downloadcombo-wip/33959-file-not-found.zip
combo-wip/33959-file-not-found.tar.gz
combo-wip/33959-file-not-found.tar.bz2
assets: use asset.name instead of asset.file.name (#33959)v2.38wip/33959-file-not-found
when accessing asset.file, the file is opened, and this can lead to an IOError
-rw-r--r--combo/apps/assets/templatetags/assets.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/combo/apps/assets/templatetags/assets.py b/combo/apps/assets/templatetags/assets.py
index 0c7e036..62283fa 100644
--- a/combo/apps/assets/templatetags/assets.py
+++ b/combo/apps/assets/templatetags/assets.py
@@ -57,7 +57,7 @@ def asset_url(*args, **kwargs):
return asset.url
geometry_string = kwargs.pop('size', None)
- if not geometry_string or asset.file.name.endswith('svg'):
+ if not geometry_string or asset.name.endswith('svg'):
return asset.url
return get_thumbnail(asset, geometry_string, **kwargs).url