server/sources/storages.py
branchstable
changeset 5994 97c55baefa0c
parent 5863 4495b9bc49df
child 6142 8bc6eac1fac1
child 6383 19ebe0b994d6
equal deleted inserted replaced
5976:00b1b6b906cf 5994:97c55baefa0c
   172         # name metadata, so we use the real file name and extension when
   172         # name metadata, so we use the real file name and extension when
   173         # available. Keeping the extension is useful for example in the case of
   173         # available. Keeping the extension is useful for example in the case of
   174         # PIL processing that use filename extension to detect content-type, as
   174         # PIL processing that use filename extension to detect content-type, as
   175         # well as providing more understandable file names on the fs.
   175         # well as providing more understandable file names on the fs.
   176         basename = [str(entity.eid), attr]
   176         basename = [str(entity.eid), attr]
   177         name = entity.attr_metadata(attr, 'name')
   177         name = entity.cw_attr_metadata(attr, 'name')
   178         if name is not None:
   178         if name is not None:
   179             basename.append(name.encode(self.fsencoding))
   179             basename.append(name.encode(self.fsencoding))
   180         fspath = uniquify_path(self.default_directory, '_'.join(basename))
   180         fspath = uniquify_path(self.default_directory, '_'.join(basename))
   181         if fspath is None:
   181         if fspath is None:
   182             msg = entity._cw._('failed to uniquify path (%s, %s)') % (
   182             msg = entity._cw._('failed to uniquify path (%s, %s)') % (