mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Merge pull request #6177 from wwitzel3/devel
add organization_id to Inventory summary fields
This commit is contained in:
commit
dfd65441b1
@ -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',
|
||||
@ -1592,8 +1593,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