mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
add organization_id to Inventory summary fields
This commit is contained in:
parent
0134b7e0bd
commit
397f24f160
@ -73,7 +73,8 @@ SUMMARIZABLE_FK_FIELDS = {
|
||||
'groups_with_active_failures',
|
||||
'has_inventory_sources',
|
||||
'total_inventory_sources',
|
||||
'inventory_sources_with_failures'),
|
||||
'inventory_sources_with_failures',
|
||||
'organization_id'),
|
||||
'host': DEFAULT_SUMMARY_FIELDS + ('has_active_failures',
|
||||
'has_inventory_sources'),
|
||||
'group': DEFAULT_SUMMARY_FIELDS + ('has_active_failures',
|
||||
@ -1591,8 +1592,6 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt
|
||||
ret = super(InventorySourceSerializer, self).to_representation(obj)
|
||||
if obj is None:
|
||||
return ret
|
||||
if obj.inventory and obj.inventory.organization:
|
||||
ret['organization'] = obj.inventory.organization.pk
|
||||
if 'inventory' in ret and not obj.inventory:
|
||||
ret['inventory'] = None
|
||||
return ret
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user