Fix URL in confirmation mail
This commit is contained in:
parent
760cac56b2
commit
8143c6286f
15
app.py
15
app.py
|
@ -27,7 +27,7 @@ def home():
|
|||
log.debug("in home")
|
||||
log.debug("session = %s", session)
|
||||
if "user" not in session:
|
||||
return redirect(url_for('register'))
|
||||
return redirect(url_for("register", target="/"))
|
||||
return render_template("home.html")
|
||||
|
||||
@app.route("/register", methods=["GET", "POST"])
|
||||
|
@ -54,9 +54,14 @@ def register():
|
|||
csr.execute(
|
||||
"insert into bod(email, key, keychange) values(%s, %s, now())",
|
||||
(email_address, key,))
|
||||
confirmation_url = url_for("confirm",
|
||||
target=request.form["target"],
|
||||
key=key)
|
||||
log.debug("request.scheme = %s", request.scheme)
|
||||
log.debug("request.server = %s", request.server)
|
||||
log.debug("request.root_url = %s", request.root_url)
|
||||
confirmation_url = \
|
||||
request.root_url + \
|
||||
url_for("confirm",
|
||||
target=request.form["target"],
|
||||
key=key)
|
||||
send_mail(email_address, confirmation_url)
|
||||
return render_template("wait_for_confirmation.html")
|
||||
|
||||
|
@ -73,6 +78,8 @@ def confirm():
|
|||
@app.route("/vote/<string:key>")
|
||||
def vote(key):
|
||||
log.debug("session = %s", session)
|
||||
if "user" not in session:
|
||||
return redirect(url_for("register", target=request.url))
|
||||
csr = get_cursor()
|
||||
csr.execute("select * from meet where key = %s", (key,))
|
||||
meet = csr.fetchone()
|
||||
|
|
Loading…
Reference in New Issue