Fix team registration

This commit is contained in:
James Wang 2016-04-08 10:57:36 -04:00
parent 765f6e0ec1
commit 5b549e0e70
No known key found for this signature in database
GPG key ID: 5B80C0B3F263CD5B
2 changed files with 2 additions and 3 deletions

View file

@ -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"])

View file

@ -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: