Skip to content

Commit

Permalink
Restore populate_state, but only execute if tool_state not given
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed May 9, 2018
1 parent 4f20aee commit 5fa450d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/galaxy/webapps/galaxy/api/workflows.py
Expand Up @@ -19,6 +19,7 @@
workflows
)
from galaxy.model.item_attrs import UsesAnnotations
from galaxy.tools.parameters import populate_state
from galaxy.util.sanitize_html import sanitize_html
from galaxy.web import _future_expose_api as expose_api
from galaxy.web.base.controller import (
Expand Down Expand Up @@ -495,6 +496,10 @@ def build_module(self, trans, payload={}):
"""
inputs = payload.get('inputs', {})
module = module_factory.from_dict(trans, payload)
if 'tool_state' not in payload:
module_state = {}
populate_state(trans, module.get_inputs(), inputs, module_state, check=False)
module.recover_state(module_state)
return {
'label' : inputs.get('__label', ''),
'annotation' : inputs.get('__annotation', ''),
Expand Down

0 comments on commit 5fa450d

Please sign in to comment.