From 0dd8efccff4560e1ef13734d4b13a30016d565dd Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 14 Nov 2018 01:27:14 +1000 Subject: [PATCH] added gross hack --- web.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/web.py b/web.py index 69943c4..86998d4 100755 --- a/web.py +++ b/web.py @@ -190,13 +190,17 @@ def do_login(): def create_password(): db, c, dc = db_reconnect() c.execute("SELECT COUNT(*) FROM data WHERE username = %s AND instance = %s", (session['username'], session['instance'])) - if c.fetchone()[0] == 0: + try: #TODO: this is a disgusting hack, REMOVE IT + if c.fetchone()[0] == 0: + db.close() + return render_template("create_password.html", bg = "background-image:url('{}')".format(session['avi'])) + else: + #user already exists in database, so they already have a password + db.close() + return redirect(url_for('main')) + except: db.close() return render_template("create_password.html", bg = "background-image:url('{}')".format(session['avi'])) - else: - #user already exists in database, so they already have a password - db.close() - return redirect(url_for('main')) @app.route('/internal/create_account', methods=['POST']) def create_account():