1
Fork 0
mirror of https://github.com/RYGhub/song.git synced 2024-11-21 20:44:20 +00:00

Make all the sessions permanent

This commit is contained in:
Steffo 2017-09-24 14:41:56 +02:00
parent b19d8e8a73
commit b34678ca07
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: C27544372FBB445D

View file

@ -26,6 +26,7 @@ def page_main():
else: else:
done = False done = False
session["last_entry"] = None session["last_entry"] = None
session.permanent = True
last_words = db.engine.execute("SELECT * FROM song ORDER BY time").fetchall() last_words = db.engine.execute("SELECT * FROM song ORDER BY time").fetchall()
return render_template("song.html", last_words=last_words, done=done) return render_template("song.html", last_words=last_words, done=done)
elif request.method == "POST": elif request.method == "POST":
@ -35,6 +36,7 @@ def page_main():
db.session.add(new_word) db.session.add(new_word)
db.session.commit() db.session.commit()
session["last_entry"] = dt.datetime.now() session["last_entry"] = dt.datetime.now()
session.permanent = True
return redirect(url_for("page_main")) return redirect(url_for("page_main"))