diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2019-08-17 14:29:49 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2019-08-17 14:29:49 +0200 |
commit | ce47bae559df59be8d8b2016cefa62c2fa00d0e2 (patch) | |
tree | 8b34702a74535a37d3753fefdb3c1111b9d3e882 /fbin/file_storage | |
parent | d7accfe7405c5132fd193d027b4da6698d5c2eda (diff) |
file_storage.filesystem: Set file mode if configured
Regression since b72ecc321c315bafe40cc7406e87e088564ab8a9. This is
needed eg. when using X-Sendfile so that the web server can access the
files.
Diffstat (limited to 'fbin/file_storage')
-rw-r--r-- | fbin/file_storage/filesystem.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fbin/file_storage/filesystem.py b/fbin/file_storage/filesystem.py index 3433baf..3b46e34 100644 --- a/fbin/file_storage/filesystem.py +++ b/fbin/file_storage/filesystem.py @@ -26,6 +26,9 @@ class Storage(BaseStorage): except: os.unlink(temp.name) raise + finally: + if self.app.config.get('DESTINATION_MODE'): + os.chmod(new_file.get_path(), self.app.config.get('DESTINATION_MODE')) def get_file(self, f): path = f.get_path() |