From 21e4afca143022b19a09e29aed7539d1365ad51d Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 14 Oct 2014 15:41:22 -0400 Subject: [PATCH] Relax type checking requirements for floats since javascript passively converts whole number floats to ints --- awx/main/models/jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index 1b6ddb30b9..b54b1423da 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -270,8 +270,8 @@ class JobTemplate(UnifiedJobTemplate, JobOptions): if 'max' in survey_element and survey_element['max'] != "" and data[survey_element['variable']] > survey_element['max']: errors.append("'%s' value %s is too large (must be no more than%s)" % (survey_element['variable'], data[survey_element['variable']], survey_element['max'])) - if type(data[survey_element['variable']]) != float: - errors.append("Value %s for %s expected to be a float" % (data[survey_element['variable']], + if type(data[survey_element['variable']]) not in (float, int): + errors.append("Value %s for %s expected to be a numeric type" % (data[survey_element['variable']], survey_element['variable'])) elif survey_element['type'] == 'multiselect': if survey_element['variable'] in data: