From 45afa23417ef997bc2382ea86a2bbe67c7114151 Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Fri, 14 May 2021 14:49:39 -0300 Subject: [PATCH] Update zwift_offline.py --- zwift_offline.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zwift_offline.py b/zwift_offline.py index 450920c..c3c7465 100644 --- a/zwift_offline.py +++ b/zwift_offline.py @@ -511,15 +511,15 @@ def authorization(): def profile(username): if request.method == "POST": if request.form['username'] == "" or request.form['password'] == "": - flash("Zwift credentials can't be empty") + flash("Zwift credentials can't be empty.") return render_template("profile.html", username=current_user.username) username = request.form['username'] - password = request.form['password'] + password = request.form['password'] player_id = current_user.player_id profile_dir = '%s/%s' % (STORAGE_DIR, str(player_id)) session = requests.session() - + try: access_token, refresh_token = online_sync.login(session, username, password) try: @@ -528,9 +528,9 @@ def profile(username): f.write(profile) online_sync.logout(session, refresh_token) os.rename('%s/profile.bin' % SCRIPT_DIR, '%s/profile.bin' % profile_dir) - flash("Zwift profile installed locally.") + flash("Zwift profile installed locally.") except: - flash("Error downloading profile") + flash("Error downloading profile.") if request.form.get("safe_zwift", None) != None: try: file_path = os.path.join(profile_dir, 'zwift_credentials.txt') @@ -540,15 +540,15 @@ def profile(username): if credentials_key is not None: with open(file_path, 'rb') as fr: zwift_credentials = fr.read() - cipher_suite = Fernet(credentials_key) + cipher_suite = Fernet(credentials_key) ciphered_text = cipher_suite.encrypt(zwift_credentials) with open(file_path, 'wb') as fw: fw.write(ciphered_text) - flash("Zwift credentials saved") + flash("Zwift credentials saved.") except: - flash("Error saving 'zwift_credentiasl.txt' file") + flash("Error saving 'zwift_credentiasl.txt' file.") except: - flash("Error invalid Username or password") + flash("Invalid username or password.") return render_template("profile.html", username=current_user.username)