mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 12:27:37 -02:30
Null check added.
This commit is contained in:
@@ -2322,7 +2322,8 @@ class WorkflowJobTemplateNodeSerializer(WorkflowNodeBaseSerializer):
|
|||||||
raise serializers.ValidationError({
|
raise serializers.ValidationError({
|
||||||
"job_type": "%s is not a valid job type. The choices are %s." % (
|
"job_type": "%s is not a valid job type. The choices are %s." % (
|
||||||
attrs['char_prompts']['job_type'], job_types)})
|
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"})
|
raise serializers.ValidationError({"workflow_job_template": "Workflow job template is missing during creation"})
|
||||||
ujt_obj = attrs.get('unified_job_template', None)
|
ujt_obj = attrs.get('unified_job_template', None)
|
||||||
if isinstance(ujt_obj, (WorkflowJobTemplate, SystemJobTemplate)):
|
if isinstance(ujt_obj, (WorkflowJobTemplate, SystemJobTemplate)):
|
||||||
|
|||||||
Reference in New Issue
Block a user