From 432242bdd22426f461c772de0c5a5c51b32df80d Mon Sep 17 00:00:00 2001 From: Aaron Tan Date: Thu, 27 Oct 2016 11:20:45 -0400 Subject: [PATCH] Null check added. --- awx/api/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index c21fbfc2b5..e6b25953d1 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -2322,7 +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: + if self.instance is None and ('workflow_job_template' not in attrs or + attrs['workflow_job_template'] is None): 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)):