1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 16:48:58 +00:00

minor stuff

This commit is contained in:
Lynne Megido 2019-09-03 13:29:50 +10:00
parent 252a8dd6cf
commit 1f7bcf58db

View file

@ -246,7 +246,7 @@ def bot_create():
# all other instance types are also unsupported # all other instance types are also unsupported
# return an error message # return an error message
#TODO: misskey #TODO: misskey
session['error'] = "Unsupported instance type." session['error'] = "Unsupported instance type. Misskey support is planned."
elif session['step'] == 2: elif session['step'] == 2:
# nothing needs to be done here, this step just informs the user that their instance type is supported # nothing needs to be done here, this step just informs the user that their instance type is supported
@ -297,6 +297,7 @@ def bot_create():
except: except:
# authentication error occurred # authentication error occurred
error = "Authentication failed." error = "Authentication failed."
session['step'] = 3
return render_template("bot_create.html", error = error) return render_template("bot_create.html", error = error)
# authentication success!! # authentication success!!
@ -386,6 +387,7 @@ def img_bot_generic():
return send_file("static/bot_generic.png", mimetype="image/png") return send_file("static/bot_generic.png", mimetype="image/png")
def bot_check(bot): def bot_check(bot):
# check to ensure bot is owned by user
c = mysql.connection.cursor() c = mysql.connection.cursor()
c.execute("SELECT COUNT(*) FROM `bots` WHERE `handle` = %s AND `user_id` = %s", (bot, session['user_id'])) c.execute("SELECT COUNT(*) FROM `bots` WHERE `handle` = %s AND `user_id` = %s", (bot, session['user_id']))
return c.fetchone()[0] == 1 return c.fetchone()[0] == 1