added 'organization' to list of related fields for inventory_scripts

This commit is contained in:
Chris Meyers 2015-01-19 08:39:55 -05:00
parent 0fcf7a51b7
commit 8705f03bf9

View File

@ -995,6 +995,14 @@ class CustomInventoryScriptSerializer(BaseSerializer):
ret['script'] = None
return ret
def get_related(self, obj):
res = super(CustomInventoryScriptSerializer, self).get_related(obj)
if obj.organization and obj.organization.active:
res['organization'] = reverse('api:organization_detail', args=(obj.organization.pk,))
return res
class InventorySourceOptionsSerializer(BaseSerializer):
class Meta: