File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030)
3131from galaxy .security .idencoding import IdEncodingHelper
3232from galaxy .structured_app import StructuredApp
33+ from galaxy .tool_util_models .parameters import DataOrCollectionRequestAdapter
3334from galaxy .util import safe_str_cmp
3435from .context import ProvidesUserContext
3536
@@ -73,11 +74,22 @@ def create_workflow_landing_request(self, payload: CreateWorkflowLandingRequestP
7374 model .workflow_source = payload .workflow_id
7475 model .uuid = uuid4 ()
7576 model .client_secret = payload .client_secret
76- model .request_state = payload .request_state
77+ model .request_state = self . validate_workflow_request_state ( payload .request_state )
7778 model .public = payload .public
7879 self ._save (model )
7980 return self ._workflow_response (model )
8081
82+ def validate_workflow_request_state (self , request_state : dict ) -> dict :
83+ # This would ideally be run in the context of a workflow input definition
84+ for key , value in request_state .items ():
85+ if isinstance (value , dict ):
86+ try :
87+ # persist values after model validators and aliases have been applied
88+ request_state [key ] = DataOrCollectionRequestAdapter .validate_python (value )
89+ except Exception :
90+ pass
91+ return request_state
92+
8193 def claim_tool_landing_request (
8294 self , trans : ProvidesUserContext , uuid : UUID4 , claim : Optional [ClaimLandingPayload ]
8395 ) -> ToolLandingRequest :
You can’t perform that action at this time.
0 commit comments