mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
Merge pull request #21 from chrismeyersfsu/improvement-inventory_script_organization_relationship
added 'organization' to list of related fields for inventory_scripts
This commit is contained in:
commit
6cb7f911b7
@ -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