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

truly fixed the weird bug. requesting / no longer resets session['step']

This commit is contained in:
Lynne Megido 2019-09-10 17:06:24 +10:00
parent 28ca5c3d83
commit 2cbad2eff3

View file

@ -30,7 +30,6 @@ def login_check():
@app.route("/") @app.route("/")
def home(): def home():
if 'user_id' in session: if 'user_id' in session:
session['step'] = 1
c = mysql.connection.cursor() c = mysql.connection.cursor()
c.execute("SELECT COUNT(*) FROM `bots` WHERE user_id = %s", (session['user_id'],)) c.execute("SELECT COUNT(*) FROM `bots` WHERE user_id = %s", (session['user_id'],))
bot_count = c.fetchone()[0] bot_count = c.fetchone()[0]
@ -334,6 +333,9 @@ def bot_accounts_add():
else: else:
error = "Couldn't access ActivityPub outbox. {} may require authenticated fetches, which FediBooks doesn't support yet.".format(instance) error = "Couldn't access ActivityPub outbox. {} may require authenticated fetches, which FediBooks doesn't support yet.".format(instance)
return render_template("bot_accounts_add.html", error = error) return render_template("bot_accounts_add.html", error = error)
else:
# new account add request
session['step'] = 1
return render_template("bot_accounts_add.html", error = session.pop('error', None)) return render_template("bot_accounts_add.html", error = session.pop('error', None))
@ -469,6 +471,10 @@ def bot_create():
del session['instance_type'] del session['instance_type']
del session['client_id'] del session['client_id']
del session['client_secret'] del session['client_secret']
else:
# user is starting a new bot create request
session['step'] = 1
return render_template("bot_create.html", error = session.pop('error', None)) return render_template("bot_create.html", error = session.pop('error', None))