From 3d05493c545bee7cf3c708afe9f6a3bc7f14bf5d Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Thu, 31 Mar 2016 10:22:10 -0400 Subject: [PATCH] use exists instead of count --- awx/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 8d7332ef4c..613080714d 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -214,7 +214,7 @@ class ApiV1ConfigView(APIView): user_ldap_fields.extend(getattr(settings, 'AUTH_LDAP_USER_FLAGS_BY_GROUP', {}).keys()) data['user_ldap_fields'] = user_ldap_fields - if request.user.is_superuser or Organization.accessible_objects(request.user, {'write': True}).count(): + if request.user.is_superuser or Organization.accessible_objects(request.user, {'write': True}).exists(): data.update(dict( project_base_dir = settings.PROJECTS_ROOT, project_local_paths = Project.get_local_path_choices(),