From 5d56e71cc9ad2f93f6ae061a4b19ff7e9f3bc8b5 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 30 May 2022 23:50:56 -0400 Subject: [PATCH] Rate limiter: fix 81e2a5a for logged-out. --- files/helpers/wrappers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 1f782cafb..0b699504d 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -7,6 +7,10 @@ import user_agents @limiter.request_filter def limiter_whitelist_admins(): + if not hasattr(g, 'agent') or not g.agent: + return False + if not hasattr(g, 'db') or not g.db: + return False v = get_logged_in_user() if not v: return False