From 633407ca9d127e203aae380f419e42e9edac2b40 Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 14 Nov 2018 01:34:59 +1000 Subject: [PATCH] removed the hack, as it doesn't seem to work anyway --- web.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/web.py b/web.py index 2072c77..343e1aa 100755 --- a/web.py +++ b/web.py @@ -192,18 +192,14 @@ 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'])) - 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: + 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')) + @app.route('/internal/create_account', methods=['POST']) def create_account(): db, c, dc = db_reconnect()