mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 17:28:51 -03:30
Don't return ids for deleted credential/inventory for ad hoc commands. Fixes https://trello.com/c/ps2bW38Q
This commit is contained in:
@@ -1543,6 +1543,10 @@ class AdHocCommandSerializer(UnifiedJobSerializer):
|
||||
if parent_model in (Host, Group):
|
||||
ret.pop('inventory', None)
|
||||
ret.pop('limit', None)
|
||||
if 'inventory' in ret and (not obj.inventory or not obj.inventory.active):
|
||||
ret['inventory'] = None
|
||||
if 'credential' in ret and (not obj.credential or not obj.credential.active):
|
||||
ret['credential'] = None
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user