Skip to content

Commit 37b9559

Browse files
committed
add extra validation for workflows artifact_type
1 parent 53a2d9b commit 37b9559

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

qiita_db/metadata_template/prep_template.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,12 +809,15 @@ def _get_predecessors(workflow, node):
809809

810810
# 2.
811811
pt_dt = self.data_type()
812+
pt_artifact = self.artifact.artifact_type
812813
workflows = [wk for wk in qdb.software.DefaultWorkflow.iter()
813-
if pt_dt in wk.data_type]
814+
if wk.artifact_type == pt_artifact and
815+
pt_dt in wk.data_type]
814816
if not workflows:
815817
# raises option a.
816-
raise ValueError(f'This preparation data type: "{pt_dt}" does not '
817-
'have valid workflows')
818+
msg = (f'This preparation data type: "{pt_dt}" and/or artifact '
819+
f'type "{pt_artifact}" does not have valid workflows')
820+
raise ValueError(msg)
818821
missing_artifacts = dict()
819822
for wk in workflows:
820823
missing_artifacts[wk] = dict()

0 commit comments

Comments
 (0)