From 3781a049651bd112e61edf78a1a23cf96d5797b5 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sun, 1 Sep 2019 17:16:52 +1000 Subject: [PATCH] redirect after signup --- webui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index b070762..8dfd6ad 100644 --- a/webui.py +++ b/webui.py @@ -1,4 +1,4 @@ -from flask import Flask, render_template, session, request +from flask import Flask, render_template, session, request, redirect, url_for from flask_mysqldb import MySQL import bcrypt import json, hashlib @@ -84,3 +84,7 @@ def do_signup(): c.execute("INSERT INTO `users` (id, email, password) VALUES (%s, %s, %s)", (user_id, request.form['email'], pw)) mysql.connection.commit() c.close() + + # success! + session['userid'] = user_id + return redirect(url_for('home'))