Skip to content
Snippets Groups Projects
Commit 616aa9b8 authored by Daniel Lyons's avatar Daniel Lyons
Browse files

Fix persisting WorkflowRequest

parent 7295ccd4
No related branches found
No related tags found
No related merge requests found
......@@ -351,7 +351,9 @@ class Workflow(Base, WorkflowIF):
def __repr__(self):
return f"<Workflow workflow_name={self.workflow_name}>"
def render_templates(self, argument: Dict, files: List[Path] = None) -> List[AbstractFile]:
def render_templates(
self, argument: Dict, files: List[Path] = None
) -> List[AbstractFile]:
"""
Render the templates associated with this workflow
:param argument: the workflow argument JSON
......@@ -429,7 +431,9 @@ class WorkflowRequest(Base, WorkflowRequestIF):
)
argument = sa.Column("argument", sa.JSON)
state = sa.Column("state", sa.String)
execution_id = sa.Column("execution_id", sa.Integer, sa.ForeignKey("capability_execution.execution_id"))
execution_id = sa.Column(
"execution_id", sa.Integer, sa.ForeignKey("capability_executions.execution_id")
)
files = relationship("WorkflowRequestFile", backref="request")
@property
......@@ -457,7 +461,7 @@ class WorkflowRequest(Base, WorkflowRequestIF):
argument=self.argument,
state=self.state,
execution_id=self.execution_id,
files=self.files
files=self.files,
)
def __getitem__(self, item):
......
from schema import create_session
from workspaces.services import WorkflowInfo
def test_persisting_workflow_request():
info = WorkflowInfo(create_session("SDM"))
null = info.lookup_workflow_definition("null")
req = info.create_workflow_request(null, {})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment