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:
parent
08a739e0d8
commit
457c40d612
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue