Projet

Général

Profil

0002-assets-use-asset.name-instead-of-asset.file.name-339.patch

Lauréline Guérin, 14 octobre 2019 15:04

Télécharger (1018 octets)

Voir les différences:

Subject: [PATCH 2/2] 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
 combo/apps/assets/templatetags/assets.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
combo/apps/assets/templatetags/assets.py
57 57
        return asset.url
58 58

  
59 59
    geometry_string = kwargs.pop('size', None)
60
    if not geometry_string or asset.file.name.endswith('svg'):
60
    if not geometry_string or asset.name.endswith('svg'):
61 61
        return asset.url
62 62

  
63 63
    return get_thumbnail(asset, geometry_string, **kwargs).url
64
-