Ensure workflow_job_template being set during node creation.

This commit is contained in:
Aaron Tan
2016-10-26 15:52:49 -04:00
parent 237587c2e7
commit 7c9e1c91db
2 changed files with 3 additions and 2 deletions

View File

@@ -2322,6 +2322,8 @@ class WorkflowJobTemplateNodeSerializer(WorkflowNodeBaseSerializer):
raise serializers.ValidationError({
"job_type": "%s is not a valid job type. The choices are %s." % (
attrs['char_prompts']['job_type'], job_types)})
if self.instance is None and 'workflow_job_template' not in attrs:
raise serializers.ValidationError({"workflow_job_template": "Workflow job template is missing during creation"})
ujt_obj = attrs.get('unified_job_template', None)
if isinstance(ujt_obj, (WorkflowJobTemplate, SystemJobTemplate)):
raise serializers.ValidationError({