mirror of
https://github.com/Fluffy-Bean/GameExpo23.git
synced 2025-07-04 21:16:19 +00:00
Switch account for settings
This commit is contained in:
parent
22b5fa13fb
commit
3d9b387ea8
5 changed files with 69 additions and 68 deletions
|
@ -1,5 +1,6 @@
|
|||
from flask import Blueprint, request, render_template, abort
|
||||
from server.models import Scores, Users
|
||||
from flask_login import login_required, current_user, logout_user
|
||||
from server.models import Scores, Users, Sessions
|
||||
from server.config import GAME_VERSION, MAX_TOP_SCORES
|
||||
|
||||
|
||||
|
@ -33,3 +34,21 @@ def index():
|
|||
@blueprint.route("/about")
|
||||
def about():
|
||||
return render_template("about.html")
|
||||
|
||||
|
||||
@blueprint.route("/settings", methods=["GET"])
|
||||
@login_required
|
||||
def settings():
|
||||
action = request.args.get("action", None)
|
||||
|
||||
if action == "logout":
|
||||
logout_user()
|
||||
flash("Successfully logged out!", "success")
|
||||
return redirect(url_for("views.index"))
|
||||
if action == "delete":
|
||||
flash("Insert delete function", "error")
|
||||
if action == "password":
|
||||
flash("Insert password change function", "error")
|
||||
|
||||
sessions = Sessions.query.filter_by(user_id=current_user.id).all()
|
||||
return render_template("settings.html", sessions=sessions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue