summaryrefslogtreecommitdiff
path: root/fbin
diff options
context:
space:
mode:
Diffstat (limited to 'fbin')
-rw-r--r--fbin/file_storage/filesystem.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/fbin/file_storage/filesystem.py b/fbin/file_storage/filesystem.py
index 07d29db..3a640bb 100644
--- a/fbin/file_storage/filesystem.py
+++ b/fbin/file_storage/filesystem.py
@@ -24,13 +24,12 @@ class Storage(BaseStorage):
new_file = self.add_file(file_hash, uploaded_file.filename, size, user, ip)
if new_file:
os.rename(temp_path, new_file.get_path())
+ if self.app.config.get('DESTINATION_MODE'):
+ os.chmod(new_file.get_path(), self.app.config.get('DESTINATION_MODE'))
return new_file
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()