From ed2b6938ba291ac222cdb324f8a1826257842391 Mon Sep 17 00:00:00 2001 From: TLSM Date: Sat, 15 Oct 2022 07:33:25 -0400 Subject: [PATCH] Amend 35fd90c9c: calc_users gets g but not g.agent. --- files/helpers/wrappers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 1caf45d85..4930c5301 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -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 {}