From e5064d14ce31eb421a82700ee4421da10a472b22 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 7 Sep 2019 19:55:37 +1000 Subject: [PATCH] fix authentication bug and user add bug --- webui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webui.py b/webui.py index cf2650b..85730f9 100644 --- a/webui.py +++ b/webui.py @@ -184,7 +184,7 @@ def bot_accounts_add(): if r.status_code == 200: # success!! c = mysql.connection.cursor() - c.execute("INSERT INTO `fedi_accounts` (`handle`, `outbox`) VALUES (%s, %s)", (request.form['account'], outbox)) + c.execute("REPLACE INTO `fedi_accounts` (`handle`, `outbox`) VALUES (%s, %s)", (request.form['account'], outbox)) c.execute("INSERT INTO `bot_learned_accounts` (`bot_id`, `fedi_id`) VALUES (%s, %s)", (session['bot'], request.form['account'])) c.close() mysql.connection.commit() @@ -307,7 +307,7 @@ def bot_create(): # authentication success!! c = mysql.connection.cursor() - c.execute("INSERT INTO `credentials` (client_id, client_secret, secret) VALUES (%s, %s, %s)", (session['client_id'], session['client_secret'], session['code'])) + c.execute("INSERT INTO `credentials` (client_id, client_secret, secret) VALUES (%s, %s, %s)", (session['client_id'], session['client_secret'], session['secret'])) credentials_id = c.lastrowid mysql.connection.commit()