mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
fix system auditor getter logic
This commit is contained in:
@@ -76,7 +76,8 @@ User.add_to_class('auditor_of_organizations', user_get_auditor_of_organizations)
|
||||
@property
|
||||
def user_is_system_auditor(user):
|
||||
if not hasattr(user, '_is_system_auditor'):
|
||||
user._is_system_auditor = Role.objects.filter(role_field='system_auditor', id=user.id).exists()
|
||||
user._is_system_auditor = user.roles.filter(
|
||||
singleton_name='system_auditor', role_field='system_auditor').exists()
|
||||
return user._is_system_auditor
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user