From dda00e98f5eb9d93b1319a3705257e5a71616052 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 17 Feb 2015 16:05:12 -0500 Subject: [PATCH] Fixing job submission for textarea if textarea min is set to 0 and the question is optional, then the UI will pass the API and empty string to the job launch endpoint --- awx/ui/static/js/helpers/JobSubmission.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index d352f6c4ce..cb0d3b8be6 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -81,7 +81,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential job_launch_data.extra_vars[fld] = scope[fld]; } // for optional text and text-areas, submit a blank string if min length is 0 - if(scope.survey_questions[i].required === false && (scope.survey_questions[i].type === "text" || scope.survey_questions[i].type === "textarea") && scope.survey_questions[i].min === 0 && scope[fld] ===""){ + if(scope.survey_questions[i].required === false && (scope.survey_questions[i].type === "text" || scope.survey_questions[i].type === "textarea") && scope.survey_questions[i].min === 0 && (scope[fld] === "" || scope[fld] === undefined)){ job_launch_data.extra_vars[fld] = ""; } }