From 15e6aa29a77f87f2d0b415a4f94b54ef51fbf92f Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 26 Nov 2014 11:14:26 -0500 Subject: [PATCH] Make sure we propogate source_script into the related fields it needs to be in --- awx/api/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 3aea7ddc6e..4a5506669b 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -967,6 +967,8 @@ class InventorySourceOptionsSerializer(BaseSerializer): if obj.credential and obj.credential.active: res['credential'] = reverse('api:credential_detail', args=(obj.credential.pk,)) + if obj.source_script and obj.source_script.active: + res['source_script'] = reverse('api:inventory_script_detail', args=(obj.source_script.pk,)) return res def validate_source(self, attrs, source): @@ -1042,8 +1044,6 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt res['inventory'] = reverse('api:inventory_detail', args=(obj.inventory.pk,)) if obj.group and obj.group.active: res['group'] = reverse('api:group_detail', args=(obj.group.pk,)) - if obj.source_script: - res['source_script'] = reverse('api:inventory_script_detail', args=(obj.source_script.pk,)) # Backwards compatibility. if obj.current_update: res['current_update'] = reverse('api:inventory_update_detail',