mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
added 'organization' to list of related fields for inventory_scripts
This commit is contained in:
parent
0fcf7a51b7
commit
8705f03bf9
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user