mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 21:46:00 -03:30
Make sure we propogate source_script into the related fields it needs to
be in
This commit is contained in:
@@ -967,6 +967,8 @@ class InventorySourceOptionsSerializer(BaseSerializer):
|
|||||||
if obj.credential and obj.credential.active:
|
if obj.credential and obj.credential.active:
|
||||||
res['credential'] = reverse('api:credential_detail',
|
res['credential'] = reverse('api:credential_detail',
|
||||||
args=(obj.credential.pk,))
|
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
|
return res
|
||||||
|
|
||||||
def validate_source(self, attrs, source):
|
def validate_source(self, attrs, source):
|
||||||
@@ -1042,8 +1044,6 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt
|
|||||||
res['inventory'] = reverse('api:inventory_detail', args=(obj.inventory.pk,))
|
res['inventory'] = reverse('api:inventory_detail', args=(obj.inventory.pk,))
|
||||||
if obj.group and obj.group.active:
|
if obj.group and obj.group.active:
|
||||||
res['group'] = reverse('api:group_detail', args=(obj.group.pk,))
|
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.
|
# Backwards compatibility.
|
||||||
if obj.current_update:
|
if obj.current_update:
|
||||||
res['current_update'] = reverse('api:inventory_update_detail',
|
res['current_update'] = reverse('api:inventory_update_detail',
|
||||||
|
|||||||
Reference in New Issue
Block a user