Merge pull request #385 from AlanCoding/devel

add whitespace in API responses about survey rejection
This commit is contained in:
Matthew Jones
2015-08-28 17:06:54 -04:00

View File

@@ -240,7 +240,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
errors.append("'%s' value %s is too small (must be at least %s)" % errors.append("'%s' value %s is too small (must be at least %s)" %
(survey_element['variable'], data[survey_element['variable']], survey_element['min'])) (survey_element['variable'], data[survey_element['variable']], survey_element['min']))
if 'max' in survey_element and survey_element['max'] not in ["", None] and len(data[survey_element['variable']]) > survey_element['max']: if 'max' in survey_element and survey_element['max'] not in ["", None] and len(data[survey_element['variable']]) > survey_element['max']:
errors.append("'%s' value %s is too large (must be no more than%s)" % errors.append("'%s' value %s is too large (must be no more than %s)" %
(survey_element['variable'], data[survey_element['variable']], survey_element['max'])) (survey_element['variable'], data[survey_element['variable']], survey_element['max']))
elif survey_element['type'] == 'integer': elif survey_element['type'] == 'integer':
if survey_element['variable'] in data: if survey_element['variable'] in data:
@@ -250,7 +250,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
(survey_element['variable'], data[survey_element['variable']], survey_element['min'])) (survey_element['variable'], data[survey_element['variable']], survey_element['min']))
if 'max' in survey_element and survey_element['max'] not in ["", None] and survey_element['variable'] in data and \ if 'max' in survey_element and survey_element['max'] not in ["", None] and survey_element['variable'] in data and \
data[survey_element['variable']] > survey_element['max']: data[survey_element['variable']] > survey_element['max']:
errors.append("'%s' value %s is too large (must be no more than%s)" % errors.append("'%s' value %s is too large (must be no more than %s)" %
(survey_element['variable'], data[survey_element['variable']], survey_element['max'])) (survey_element['variable'], data[survey_element['variable']], survey_element['max']))
if type(data[survey_element['variable']]) != int: if type(data[survey_element['variable']]) != int:
errors.append("Value %s for %s expected to be an integer" % (data[survey_element['variable']], errors.append("Value %s for %s expected to be an integer" % (data[survey_element['variable']],
@@ -261,7 +261,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
errors.append("'%s' value %s is too small (must be at least %s)" % errors.append("'%s' value %s is too small (must be at least %s)" %
(survey_element['variable'], data[survey_element['variable']], survey_element['min'])) (survey_element['variable'], data[survey_element['variable']], survey_element['min']))
if 'max' in survey_element and survey_element['max'] not in ["", None] and data[survey_element['variable']] > survey_element['max']: if 'max' in survey_element and survey_element['max'] not in ["", None] and data[survey_element['variable']] > survey_element['max']:
errors.append("'%s' value %s is too large (must be no more than%s)" % errors.append("'%s' value %s is too large (must be no more than %s)" %
(survey_element['variable'], data[survey_element['variable']], survey_element['max'])) (survey_element['variable'], data[survey_element['variable']], survey_element['max']))
if type(data[survey_element['variable']]) not in (float, int): 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']], errors.append("Value %s for %s expected to be a numeric type" % (data[survey_element['variable']],
@@ -1085,4 +1085,3 @@ class SystemJob(UnifiedJob, SystemJobOptions):
@property @property
def task_impact(self): def task_impact(self):
return 150 return 150