web/views/staticcontrollers.py
branchstable
changeset 9233 7d3316bfa4ff
parent 9229 739ae5366bed
child 9234 ce504d23edf7
equal deleted inserted replaced
9232:430a7dc5e2cf 9233:7d3316bfa4ff
   197         if relpath.startswith(self.data_modconcat_basepath):
   197         if relpath.startswith(self.data_modconcat_basepath):
   198             paths = relpath[len(self.data_modconcat_basepath):].split(',')
   198             paths = relpath[len(self.data_modconcat_basepath):].split(',')
   199             filepath = self.concat_files_registry.concat_cached_filepath(paths)
   199             filepath = self.concat_files_registry.concat_cached_filepath(paths)
   200         else:
   200         else:
   201             # skip leading '/data/' and url params
   201             # skip leading '/data/' and url params
   202             relpath = relpath[len(self.base_datapath):].split('?', 1)[0]
   202             if relpath.startswith(self.base_datapath):
       
   203                 prefix = self.base_datapath
       
   204             else:
       
   205                 prefix = 'data/'
       
   206             relpath = relpath[len(prefix):]
       
   207             relpath = relpath.split('?', 1)[0]
   203             dirpath, rid = config.locate_resource(relpath)
   208             dirpath, rid = config.locate_resource(relpath)
   204             if dirpath is None:
   209             if dirpath is None:
   205                 raise NotFound()
   210                 raise NotFound()
   206             filepath = osp.join(dirpath, rid)
   211             filepath = osp.join(dirpath, rid)
   207         return self.static_file(filepath)
   212         return self.static_file(filepath)