From 0134b7e0bda26ee67e165353f62f59c5bdc9bd3f Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Wed, 3 May 2017 15:29:21 -0400 Subject: [PATCH] Add organization to the InventorySource fields --- awx/api/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index e277fe314e..b976ef9a42 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -1591,6 +1591,8 @@ 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