Ejemplo n.º 1
0
def college_list():
    if handle_authentication(request.args):
        teacher_username = get_username(request.args["token"])
        instance = User(teacher_username, PATH + "/userman")
        college = instance.college()
        obj = {}
        obj["college_name"] = college.name()
        obj["userids"]      = college.users()
        obj["teams"]        = college.teams()
        return json.dumps(obj), 200

    return "{}", 403
Ejemplo n.º 2
0
def register_user():
    if handle_authentication(request.form):
        teacher_username = get_username(request.form["token"])
        instance         = User(teacher_username, PATH + "/userman")
        college_group    = instance.college().group_name
        first_name       = request.form["first_name"].strip()
        last_name        = request.form["last_name"].strip()
        email            = request.form["email"].strip()
        team             = request.form["team"].strip()
        helpers.register_user(teacher_username, college_group, first_name, last_name, email, team)
        return "", 200
    return "", 403