Commit dd2eed6e by Timothée Peignier

raise an exception rather than writing to static root silently

parent d0db8fcb
......@@ -90,22 +90,18 @@ class BaseFinderStorage(PipelineStorage):
return storage
if os.path.splitext(path)[0] == os.path.splitext(name)[0]:
return storage
return None
raise ValueError("The file '%s' could not be found with %r." % (name, self))
def _open(self, name, mode="rb"):
storage = self.find_storage(name)
if storage:
return storage._open(name, mode)
return super(BaseFinderStorage, self)._open(name, mode)
def _save(self, name, content):
storage = self.find_storage(name)
if storage:
# Ensure we overwrite file, since we have no control on external storage
if storage.exists(name):
storage.delete(name)
return storage._save(name, content)
return super(BaseFinderStorage, self)._save(name, content)
class PipelineFinderStorage(BaseFinderStorage):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment