ToolForm: Replace default value after validation

This commit is contained in:
Aysam Guerler
2015-01-29 12:55:02 -05:00
parent f3895fdc36
commit f98578349f
+6 -4
View File
@@ -2405,9 +2405,7 @@ class Tool( object, Dictifiable ):
pass
group_state[input.test_param.name] = value
else:
default_value = incoming.get(key, None)
if not default_value:
default_value = state[input.name]
default_value = incoming.get(key, state.get(input.name, None))
value, error = check_state(trans, input, default_value, context)
if error:
errors[key] = error
@@ -2458,7 +2456,11 @@ class Tool( object, Dictifiable ):
# sanitize values
sanitize(tool_dict, 'value')
sanitize(tool_dict, 'default_value')
# use default value
if not tool_dict['value']:
tool_dict['value'] = tool_dict['default_value']
# backup final input dictionary
group_inputs[input_index] = tool_dict