diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 6bd5672a8..3f2466108 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -9,6 +9,10 @@ import user_agents import time def calc_users(v): + # Some globals we expect aren't available when rendering error pages + if not g.agent or not ('session_id' in session): + return '' + loggedin = cache.get(f'{SITE}_loggedin') or {} loggedout = cache.get(f'{SITE}_loggedout') or {} timestamp = int(time.time())