yunzi7's picture
fix redirect
e389135
raw
history blame
751 Bytes
from flask import Blueprint
from flask import flash
from flask import g
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from werkzeug.exceptions import abort
from flask import session
from .auth import login_required
from .db import get_db
bp = Blueprint("index", __name__)
@bp.route("/", methods=["GET", "POST"])
def index() -> None:
match request.method:
case "GET":
return render_template("index.html")
case "POST": # index.htmlμ—μ„œ `λ‹€μŒ` λ²„νŠΌ λˆŒλ €μ„ λ•Œ
session["team_number"] = request.form.get("team_number")
session["team_size"] = request.form.get("team_size")
return redirect(url_for("qr.qr"))