Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Aug 3, 2023
1 parent 239e367 commit 501169b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qiita_db/metadata_template/prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,10 @@ def _get_predecessors(workflow, node):
# if there is a workflow, we would need to get the artifact_type from
# the job
if workflow is not None:
current_job = list(workflow.graph.nodes())[0]
starting_job = list(workflow.graph.nodes())[0]
pt_artifact = current_job.parameters.values['artifact_type']
else:
current_job = None
starting_job = None
pt_artifact = self.artifact.artifact_type
workflows = [wk for wk in qdb.software.DefaultWorkflow.iter()
if wk.artifact_type == pt_artifact and
Expand Down Expand Up @@ -899,13 +899,15 @@ def _get_predecessors(workflow, node):

cmds_to_create.append([pdp_cmd, params, reqp])

if workflow is not None:
if starting_job is not None:
init_artifacts = {
wkartifact_type: f'{current_job.id}:'}
wkartifact_type: f'{starting_job.id}:'}
starting_job = None
else:
init_artifacts = {wkartifact_type: self.artifact.id}

cmds_to_create.reverse()
current_job = None
for i, (cmd, params, rp) in enumerate(cmds_to_create):
previous_job = current_job
if previous_job is None:
Expand Down

0 comments on commit 501169b

Please sign in to comment.