in case of errors

master
James Sigurðarson 2016-07-15 21:23:19 +00:00
parent 2dbe921da9
commit b284dbb5cb
1 changed files with 1 additions and 1 deletions

2
app.py
View File

@ -25,12 +25,12 @@ else:
@app.before_request
def make_info_available():
if "user_id" in session:
g.logged_in = True
try:
g.user = User.get(User.id == session["user_id"])
g.user_restricts = g.user.restricts.split(",")
g.team = g.user.team
g.team_restricts = g.team.restricts.split(",")
g.logged_in = True
except User.DoesNotExist:
g.logged_in = False
session.pop("user_id")