From 98d53f217f83ee88daa3f1aea55010184146ac75 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Fri, 25 Nov 2022 14:31:07 -0600 Subject: [PATCH] api: don't hit calc_users if this is the API sometimes we render HTML where we probably... shouldn't. in most cases this is fine, but if API clients hit it it can errenously set --- files/routes/wrappers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 7a979058e..caf13c5c7 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -18,6 +18,7 @@ def session_init(): session["session_id"] = secrets.token_hex(49) def calc_users(v): + if g.is_api_or_xhr: return loggedin = cache.get(f'{SITE}_loggedin') or {} loggedout = cache.get(f'{SITE}_loggedout') or {} timestamp = int(time.time())