commit/galaxy-central: jmchilton: If 'populating' state from tool API request - stop processing tree on conditional test param error.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/7c6fce1fd9e7/ Changeset: 7c6fce1fd9e7 User: jmchilton Date: 2014-04-16 16:11:31 Summary: If 'populating' state from tool API request - stop processing tree on conditional test param error. Attempting to populate the state below the conditional parameter can result in uncaught exceptions in some cases. See Peter's post here - http://dev.list.galaxyproject.org/Unclear-API-and-Twill-test-failure-for-und... for example. Affected #: 1 file diff -r cd73af9c02e7f94d76239c010da12fcf1f91d1d4 -r 7c6fce1fd9e7f7adb4811cd92a56cdff05ea748d lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2133,28 +2133,31 @@ context, source ) - current_case = input.get_current_case( value, trans ) - # Current case has changed, throw away old state - group_state = state[input.name] = {} - # TODO: we should try to preserve values if we can - self.fill_in_new_state( trans, input.cases[current_case].inputs, group_state, context, history=history ) - group_errors = self.populate_state( trans, - input.cases[current_case].inputs, - group_state, - incoming, - history, - source, - prefix=group_prefix, - context=context, - ) if test_param_error: - group_errors[ input.test_param.name ] = test_param_error - if group_errors: - errors[ input.name ] = group_errors - # Store the current case in a special value - group_state['__current_case__'] = current_case - # Store the value of the test element - group_state[ input.test_param.name ] = value + errors[ input.name ] = [ test_param_error ] + # Store the value of the test element + group_state[ input.test_param.name ] = value + else: + current_case = input.get_current_case( value, trans ) + # Current case has changed, throw away old state + group_state = state[input.name] = {} + # TODO: we should try to preserve values if we can + self.fill_in_new_state( trans, input.cases[current_case].inputs, group_state, context, history=history ) + group_errors = self.populate_state( trans, + input.cases[current_case].inputs, + group_state, + incoming, + history, + source, + prefix=group_prefix, + context=context, + ) + if group_errors: + errors[ input.name ] = group_errors + # Store the current case in a special value + group_state['__current_case__'] = current_case + # Store the value of the test element + group_state[ input.test_param.name ] = value elif isinstance( input, UploadDataset ): group_state = state[input.name] group_errors = [] Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org