Some code cleanup

This commit is contained in:
Julien Duponchelle 2015-02-23 17:28:17 +01:00
parent c9314ec509
commit 89b7d62ec6

View File

@ -55,8 +55,8 @@ class UploadHandler:
try: try:
os.makedirs(UploadHandler.image_directory(), exist_ok=True) os.makedirs(UploadHandler.image_directory(), exist_ok=True)
with open(destination_path, "wb+") as f: with open(destination_path, "wb+") as f:
f.write(data["file"].file.read()) chunk = data["file"].file.read()
print(destination_path) f.write(chunk)
st = os.stat(destination_path) st = os.stat(destination_path)
os.chmod(destination_path, st.st_mode | stat.S_IXUSR) os.chmod(destination_path, st.st_mode | stat.S_IXUSR)
except OSError as e: except OSError as e: