dfs
This commit is contained in:
parent
c859843de7
commit
811cdd10a1
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ def get_logged_in_user():
|
|||
token = request.headers.get("Authorization","").strip()
|
||||
|
||||
if token:
|
||||
if g.db: client = g.db.query(ClientAuth).filter(ClientAuth.access_token == token).one_or_none()
|
||||
if hasattr(g, 'db') and g.db: client = g.db.query(ClientAuth).filter(ClientAuth.access_token == token).one_or_none()
|
||||
else: return None
|
||||
|
||||
if not client: return None
|
||||
|
@ -21,7 +21,7 @@ def get_logged_in_user():
|
|||
|
||||
nonce = session.get("login_nonce", 0)
|
||||
try:
|
||||
if g.db: v = g.db.query(User).filter_by(id=lo_user).one_or_none()
|
||||
if hasattr(g, 'db') and g.db: v = g.db.query(User).filter_by(id=lo_user).one_or_none()
|
||||
else: return None
|
||||
except: return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue