diff options
Diffstat (limited to 'fbin/file_storage/filesystem.py')
-rw-r--r-- | fbin/file_storage/filesystem.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fbin/file_storage/filesystem.py b/fbin/file_storage/filesystem.py index 1259002..07d29db 100644 --- a/fbin/file_storage/filesystem.py +++ b/fbin/file_storage/filesystem.py @@ -22,7 +22,8 @@ class Storage(BaseStorage): size = os.path.getsize(temp_path) try: new_file = self.add_file(file_hash, uploaded_file.filename, size, user, ip) - os.rename(temp_path, new_file.get_path()) + if new_file: + os.rename(temp_path, new_file.get_path()) return new_file except: os.unlink(temp.name) |