From 67b75e5a4feb3e424d968b3f1ef7c1edada89fc8 Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Fri, 30 Oct 2020 22:17:55 -0300 Subject: [PATCH] Update zwift_offline.py --- zwift_offline.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zwift_offline.py b/zwift_offline.py index 1f6933a..1576348 100644 --- a/zwift_offline.py +++ b/zwift_offline.py @@ -169,6 +169,9 @@ def upload(username): abort(401) profile_path = os.path.join(STORAGE_DIR, C["profile"].value) + if not os.path.isdir(profile_path): + os.makedirs(profile_path) + if request.method == 'POST': uploaded_file = request.files['file'] if uploaded_file.filename in ['profile.bin', 'strava_token.txt']: @@ -178,6 +181,7 @@ def upload(username): flash("Invalid file name.") return render_template("user_home.html", username=username) + name = '' profile = None profile_file = os.path.join(profile_path, 'profile.bin') if os.path.isfile(profile_file):