mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
Add pending_deletion check to job relaunch validation
This commit is contained in:
parent
e1ee95234e
commit
baa7478ff0
@ -2630,7 +2630,7 @@ class JobRelaunchSerializer(JobSerializer):
|
||||
raise serializers.ValidationError(dict(credential=[_("Credential not found or deleted.")]))
|
||||
if obj.project is None:
|
||||
raise serializers.ValidationError(dict(errors=[_("Job Template Project is missing or undefined.")]))
|
||||
if obj.inventory is None:
|
||||
if obj.inventory is None or obj.inventory.pending_deletion:
|
||||
raise serializers.ValidationError(dict(errors=[_("Job Template Inventory is missing or undefined.")]))
|
||||
attrs = super(JobRelaunchSerializer, self).validate(attrs)
|
||||
return attrs
|
||||
|
Loading…
Reference in New Issue
Block a user