From 7dec467356ec26d25b909b5fa0054415fb783dba Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Fri, 28 Feb 2025 15:38:46 +1000 Subject: [PATCH] [QOLSVC-9300] handle anonymous user objects gracefully --- ckanext/qgov/common/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/qgov/common/helpers.py b/ckanext/qgov/common/helpers.py index 8249be0..78f5ab2 100644 --- a/ckanext/qgov/common/helpers.py +++ b/ckanext/qgov/common/helpers.py @@ -75,7 +75,7 @@ def random_tags(): def user_has_admin_access(include_editor_access): user = toolkit.current_user or toolkit.g.userobj # If user is "None" - they are not logged in. - if not user: + if not user or user.is_anonymous: return False if user.sysadmin: return True