mirror of
https://github.com/Doctorado-ML/beflask.git
synced 2025-08-15 23:25:51 +00:00
add username to downloads folder
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -9,4 +9,8 @@
|
|||||||
],
|
],
|
||||||
"python.testing.unittestEnabled": false,
|
"python.testing.unittestEnabled": false,
|
||||||
"python.testing.pytestEnabled": true,
|
"python.testing.pytestEnabled": true,
|
||||||
|
"sonarlint.connectedMode.project": {
|
||||||
|
"connectionId": "doctorado-ml",
|
||||||
|
"projectKey": "Doctorado-ML_beflask"
|
||||||
|
},
|
||||||
}
|
}
|
@@ -195,8 +195,13 @@ def excel():
|
|||||||
def download(file_name):
|
def download(file_name):
|
||||||
os.chdir(current_user.benchmark.folder)
|
os.chdir(current_user.benchmark.folder)
|
||||||
src = os.path.join(current_user.benchmark.folder, Folders.excel, file_name)
|
src = os.path.join(current_user.benchmark.folder, Folders.excel, file_name)
|
||||||
dest = os.path.join("static", "excel", file_name)
|
dest_path = os.path.join("static", "excel", current_user.username)
|
||||||
|
dest = os.path.join(dest_path, file_name)
|
||||||
os.chdir(current_app.root_path)
|
os.chdir(current_app.root_path)
|
||||||
|
try:
|
||||||
|
os.makedirs(dest_path)
|
||||||
|
except FileExistsError:
|
||||||
|
pass
|
||||||
shutil.copyfile(src, dest)
|
shutil.copyfile(src, dest)
|
||||||
return send_file(dest, as_attachment=True)
|
return send_file(dest, as_attachment=True)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user