in case of errors
parent
2dbe921da9
commit
b284dbb5cb
2
app.py
2
app.py
|
@ -25,12 +25,12 @@ else:
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def make_info_available():
|
def make_info_available():
|
||||||
if "user_id" in session:
|
if "user_id" in session:
|
||||||
|
g.logged_in = True
|
||||||
try:
|
try:
|
||||||
g.user = User.get(User.id == session["user_id"])
|
g.user = User.get(User.id == session["user_id"])
|
||||||
g.user_restricts = g.user.restricts.split(",")
|
g.user_restricts = g.user.restricts.split(",")
|
||||||
g.team = g.user.team
|
g.team = g.user.team
|
||||||
g.team_restricts = g.team.restricts.split(",")
|
g.team_restricts = g.team.restricts.split(",")
|
||||||
g.logged_in = True
|
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
g.logged_in = False
|
g.logged_in = False
|
||||||
session.pop("user_id")
|
session.pop("user_id")
|
||||||
|
|
Loading…
Reference in New Issue