From 494a58593b2a3c40da5d6faab22f1319dfe0dbfb Mon Sep 17 00:00:00 2001 From: piair Date: Mon, 21 Aug 2023 20:46:09 +0200 Subject: [PATCH] =?UTF-8?q?plus=20de=20redirect=20d=C3=A9biles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Flask/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Flask/app.py b/Flask/app.py index c332fef..cb14767 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -421,16 +421,17 @@ def allowed_file(filename): @login_required def upload_file(): print(request.files) + print(request) # check if the post request has the file part if 'file' not in request.files: print('No file part') - return redirect('settings') + return redirect(url_for('settings')) file = request.files['file'] # If the user does not select a file, the browser submits an # empty file without a filename. if file.filename == '': print('No selected file') - return redirect('settings') + return redirect(url_for('settings')) if file and allowed_file(file.filename): filename = secure_filename(file.filename) file.save(os.path.join('/app/MsRewards-Reborn/user_data/', filename))