mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
added 'organization' to list of related fields for inventory_scripts
This commit is contained in:
@@ -995,6 +995,14 @@ class CustomInventoryScriptSerializer(BaseSerializer):
|
|||||||
ret['script'] = None
|
ret['script'] = None
|
||||||
return ret
|
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 InventorySourceOptionsSerializer(BaseSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user