server/sources/storages.py
changeset 7398 26695dd703d8
parent 7118 e094b3d4eb95
child 7454 1090724f28ed
equal deleted inserted replaced
7397:6a9e66d788b3 7398:26695dd703d8
   197                 self.default_directory, '_'.join(basename))
   197                 self.default_directory, '_'.join(basename))
   198             raise ValidationError(entity.eid, {role_name(attr, 'subject'): msg})
   198             raise ValidationError(entity.eid, {role_name(attr, 'subject'): msg})
   199         return fspath
   199         return fspath
   200 
   200 
   201     def current_fs_path(self, entity, attr):
   201     def current_fs_path(self, entity, attr):
   202         sysource = entity._cw.pool.source('system')
   202         sysource = entity._cw.cnxset.source('system')
   203         cu = sysource.doexec(entity._cw,
   203         cu = sysource.doexec(entity._cw,
   204                              'SELECT cw_%s FROM cw_%s WHERE cw_eid=%s' % (
   204                              'SELECT cw_%s FROM cw_%s WHERE cw_eid=%s' % (
   205                              attr, entity.__regid__, entity.eid))
   205                              attr, entity.__regid__, entity.eid))
   206         rawvalue = cu.fetchone()[0]
   206         rawvalue = cu.fetchone()[0]
   207         if rawvalue is None: # no previous value
   207         if rawvalue is None: # no previous value