Remove the hosts count from related_field_counts in the org api endpoints

It is probably not needed, and adds an additional db query.
This commit is contained in:
Jeff Bradberry
2019-02-18 16:35:22 -05:00
parent 4d06ae48d3
commit 3312ebcb05
4 changed files with 11 additions and 28 deletions

View File

@@ -1259,7 +1259,7 @@ class OrganizationSerializer(BaseSerializer):
if counts_dict is not None and summary_dict is not None:
if obj.id not in counts_dict:
summary_dict['related_field_counts'] = {
'inventories': 0, 'teams': 0, 'users': 0, 'hosts': 0,
'inventories': 0, 'teams': 0, 'users': 0,
'job_templates': 0, 'admins': 0, 'projects': 0}
else:
summary_dict['related_field_counts'] = counts_dict[obj.id]