Add team id to session
This commit is contained in:
parent
796fac7f85
commit
f38063a2d5
2 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
from flask import Blueprint, request
|
||||
from flask import Blueprint, request, session
|
||||
from flask import current_app as app
|
||||
from voluptuous import Schema, Length, Required
|
||||
|
||||
|
@ -35,6 +35,7 @@ def team_create():
|
|||
Users.query.filter_by(uid=_user.uid).update({ "tid": team.tid })
|
||||
db.session.commit()
|
||||
|
||||
session["tid"] = team.tid
|
||||
return { "success": 1, "message": "Success!" }
|
||||
|
||||
@blueprint.route("/invite", methods=["POST"])
|
||||
|
|
|
@ -237,6 +237,8 @@ def login_user(username, password):
|
|||
session["sid"] = token.sid
|
||||
session["username"] = token.username
|
||||
session["admin"] = user.admin == True
|
||||
if user.tid is not None and user.tid >= 0:
|
||||
session["tid"] = user.tid
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue