commit/galaxy-central: dan: Fix for workflow editor in call to check_param on input parameters that need late validation but were attempting to run validators.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8d4ceccae236/ Changeset: 8d4ceccae236 Branch: next-stable User: dan Date: 2014-04-14 21:44:36 Summary: Fix for workflow editor in call to check_param on input parameters that need late validation but were attempting to run validators. Affected #: 2 files diff -r a0769a6caf2a073209a9249df99b40a110c0f961 -r 8d4ceccae2367e06bc05f93bfdc51119a962307b lib/galaxy/tools/parameters/__init__.py --- a/lib/galaxy/tools/parameters/__init__.py +++ b/lib/galaxy/tools/parameters/__init__.py @@ -53,16 +53,18 @@ value = incoming_value error = None try: - if value is not None or isinstance(param, DataToolParameter): + if value is not None or isinstance( param, DataToolParameter ): # Convert value from HTML representation if source == 'html': value = param.from_html( value, trans, param_values ) else: value = param.from_json( value, trans, param_values ) - # Allow the value to be converted if neccesary - filtered_value = param.filter_value( value, trans, param_values ) - # Then do any further validation on the value - param.validate( filtered_value, trans.history ) + # Only validate if late validation is not needed + if not param.need_late_validation( trans, param_values ): + # Allow the value to be converted if necessary + filtered_value = param.filter_value( value, trans, param_values ) + # Then do any further validation on the value + param.validate( filtered_value, trans.history ) elif value is None and isinstance( param, SelectToolParameter ): # An empty select list or column list param.validate( value, trans.history ) diff -r a0769a6caf2a073209a9249df99b40a110c0f961 -r 8d4ceccae2367e06bc05f93bfdc51119a962307b lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -183,6 +183,9 @@ for validator in self.validators: validator.validate( value, history ) + def need_late_validation( self, trans, context ): + return False + def to_dict( self, trans, view='collection', value_mapper=None ): """ to_dict tool parameter. This can be overridden by subclasses. """ tool_dict = super( ToolParameter, self ).to_dict() @@ -1774,6 +1777,11 @@ else: validator.validate( value, history ) + def need_late_validation( self, trans, context ): + if trans is None or trans.workflow_building_mode: + return True + return False + def get_dependencies( self ): """ Get the *names* of the other params this param depends on. 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