mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Merge pull request #343 from jangsutsr/7530_add_pending_deletion_check_to_job_relaunch_validation
Add pending_deletion check to job relaunch validation
This commit is contained in:
commit
853b9d1001
@ -2630,7 +2630,7 @@ class JobRelaunchSerializer(JobSerializer):
|
|||||||
raise serializers.ValidationError(dict(credential=[_("Credential not found or deleted.")]))
|
raise serializers.ValidationError(dict(credential=[_("Credential not found or deleted.")]))
|
||||||
if obj.project is None:
|
if obj.project is None:
|
||||||
raise serializers.ValidationError(dict(errors=[_("Job Template Project is missing or undefined.")]))
|
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.")]))
|
raise serializers.ValidationError(dict(errors=[_("Job Template Inventory is missing or undefined.")]))
|
||||||
attrs = super(JobRelaunchSerializer, self).validate(attrs)
|
attrs = super(JobRelaunchSerializer, self).validate(attrs)
|
||||||
return attrs
|
return attrs
|
||||||
|
Loading…
Reference in New Issue
Block a user