assets: use asset.name instead of asset.file.name (#33959)

when accessing asset.file, the file is opened, and this can lead to an
IOError
This commit is contained in:
Lauréline Guérin 2019-10-14 15:02:24 +02:00
parent 08a739e0d8
commit 457c40d612
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 1 additions and 1 deletions

View File

@ -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