From f98578349f18c634938c9ec33c0f68481e91c945 Mon Sep 17 00:00:00 2001 From: Aysam Guerler Date: Thu, 29 Jan 2015 12:55:02 -0500 Subject: [PATCH] ToolForm: Replace default value after validation --- lib/galaxy/tools/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index dd5c7264cbb..faec5548dec 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -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