don't want to crash on our precious logging code

pull/24/head
justcool393 2022-11-25 20:22:55 -06:00 committed by geese_suck
parent eb338fd00d
commit 3e53295516
Signed by: geese_suck
GPG Key ID: 4D09E4B0A7264746
1 changed files with 2 additions and 2 deletions

View File

@ -23,11 +23,11 @@ def calc_users(v):
print("calc_users called with missing context data")
if request:
print(f"while serving {request.method} {request.full_path}")
print(f"user agent: {g.agent}")
print(f"user agent: {getattr(g, 'agent', '-attribute not present-')}")
else:
print("no request context")
print(f"v: {v}")
print(f"db?: {bool(g.db)}")
print(f"db?: {bool(getattr(g, 'db', None))}")
# end temp logging code
loggedin = cache.get(f'{SITE}_loggedin') or {}
loggedout = cache.get(f'{SITE}_loggedout') or {}