Fix team registration
This commit is contained in:
parent
765f6e0ec1
commit
5b549e0e70
2 changed files with 2 additions and 3 deletions
|
@ -29,15 +29,14 @@ def team_create():
|
|||
school = params.get("school")
|
||||
|
||||
team = Teams(teamname, school, _user.uid, _user.utype != 1)
|
||||
tid = team.tid
|
||||
with app.app_context():
|
||||
db.session.add(team)
|
||||
db.session.commit()
|
||||
Users.query.filter_by(uid=_user.uid).update({ "tid": team.tid })
|
||||
db.session.commit()
|
||||
session["tid"] = team.tid
|
||||
db.session.close()
|
||||
|
||||
session["tid"] = team.tid
|
||||
return { "success": 1, "message": "Success!" }
|
||||
|
||||
@blueprint.route("/delete", methods=["POST"])
|
||||
|
|
|
@ -133,7 +133,7 @@ def user_status():
|
|||
"logged_in": logged_in,
|
||||
"admin": is_admin(),
|
||||
"competition": is_admin(),
|
||||
"in_team": in_team(get_user()),
|
||||
"in_team": in_team(get_user().first()),
|
||||
"username": session["username"] if logged_in else "",
|
||||
}
|
||||
if logged_in:
|
||||
|
|
Loading…
Reference in a new issue