Add organization to the InventorySource fields

This commit is contained in:
Wayne Witzel III 2017-05-03 15:29:21 -04:00
parent 17a65bd67b
commit 0134b7e0bd

View File

@ -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