update JT playbook validation for HA

This commit is contained in:
AlanCoding 2016-10-24 16:31:33 -04:00
parent cd48427189
commit 3c24105271

View File

@ -1847,7 +1847,7 @@ class JobOptionsSerializer(LabelsListMixin, BaseSerializer):
job_type = attrs.get('job_type', self.instance and self.instance.job_type or None)
if not project and job_type != PERM_INVENTORY_SCAN:
raise serializers.ValidationError({'project': 'This field is required.'})
if project and playbook and force_text(playbook) not in project.playbooks:
if project and playbook and force_text(playbook) not in project.playbook_files:
raise serializers.ValidationError({'playbook': 'Playbook not found for project.'})
if project and not playbook:
raise serializers.ValidationError({'playbook': 'Must select playbook for project.'})