예제 #1
0
파일: task.py 프로젝트: BitK-/ctfBoard
def show_one_task(name):
    if not "login" in session:
        return redirect(url_for("login"))
    task = sql.getTask(name)
    issolved = sql.isSolved(name, session["login"])
    if task is None:
        abort(404)
    if request.method == "POST":
        doPost(name, task, issolved)

    solver = [
        "%s (alias %s)" % (x.name, x.pseudo) if x.pseudo else x.name
        for x in sql.getSolver(name)
        if (not x.hide or session["admin"])
    ]
    return render_template("main.html", view="show_task.html", solver=solver, task=task)