Пример #1
0
def index_student(room_name, role):
    if not Room.exists(room_name):
        return redirect(url_for("app.index_room"))
    elif role not in ["student", "assistant"]:
        return redirect(url_for("app.index_role"))

    return render_template("{}.html".format(role))
Пример #2
0
def addroom(name, password, description):
    if name is "":
        print("Error: Name is empty")
        return

    if password is "":
        print("Warning: Password is empty")

    with app.app_context():
        if Room.exists(name):
            print("Error: Room {} already exists".format(name))
            return

        Room.add(name=name, password=password, description=description)
        print("Success: Room {} added".format(name))
Пример #3
0
def index_role(room_name):
    if not Room.exists(room_name):
        return redirect(url_for("app.index_room"))

    return render_template("index_role.html")  # Choice of role