Amend 35fd90c9c: calc_users gets g but not g.agent.

master
Snakes 2022-10-15 07:33:25 -04:00
parent 35fd90c9ca
commit ed2b6938ba
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ import time
def calc_users(v):
# Some globals we expect aren't available when rendering error pages
if not g or not g.agent or not session or not ('session_id' in session):
if (not g or not hasattr(g, 'agent')
or not session or not ('session_id' in session)):
return ''
loggedin = cache.get(f'{SITE}_loggedin') or {}