From dea5fd1a9df010e4e61b7ced7cf6077db932be8b Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Thu, 13 Jan 2022 14:44:50 -0500 Subject: [PATCH] Fix a problem with IsSystemAdminOrAuditor for anonymous users It was raising an error, but should really show the message about not being authenticated. --- awx/api/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/permissions.py b/awx/api/permissions.py index a951928626..bd6328495b 100644 --- a/awx/api/permissions.py +++ b/awx/api/permissions.py @@ -243,7 +243,7 @@ class IsSystemAdminOrAuditor(permissions.BasePermission): """ def has_permission(self, request, view): - if not request.user: + if not (request.user and request.user.is_authenticated): return False if request.method == 'GET': return request.user.is_superuser or request.user.is_system_auditor