diff --git a/qiita_db/metadata_template/prep_template.py b/qiita_db/metadata_template/prep_template.py index 26ef5ca52..e97984252 100644 --- a/qiita_db/metadata_template/prep_template.py +++ b/qiita_db/metadata_template/prep_template.py @@ -809,12 +809,15 @@ def _get_predecessors(workflow, node): # 2. pt_dt = self.data_type() + pt_artifact = self.artifact.artifact_type workflows = [wk for wk in qdb.software.DefaultWorkflow.iter() - if pt_dt in wk.data_type] + if wk.artifact_type == pt_artifact and + pt_dt in wk.data_type] if not workflows: # raises option a. - raise ValueError(f'This preparation data type: "{pt_dt}" does not ' - 'have valid workflows') + msg = (f'This preparation data type: "{pt_dt}" and/or artifact ' + f'type "{pt_artifact}" does not have valid workflows') + raise ValueError(msg) missing_artifacts = dict() for wk in workflows: missing_artifacts[wk] = dict() diff --git a/qiita_db/metadata_template/test/test_prep_template.py b/qiita_db/metadata_template/test/test_prep_template.py index 4cc3c73b9..28447a665 100644 --- a/qiita_db/metadata_template/test/test_prep_template.py +++ b/qiita_db/metadata_template/test/test_prep_template.py @@ -1417,8 +1417,9 @@ def test_artifact_setter(self): qdb.sql_connection.perform_as_transaction( 'UPDATE qiita.default_workflow SET artifact_type_id = 10 WHERE ' 'default_workflow_id = 1') - with self.assertRaisesRegex(ValueError, 'taxa_summary is not part of ' - 'this preparation and cannot be applied'): + with self.assertRaisesRegex(ValueError, 'This preparation data type: ' + '"16S" and/or artifact type "FASTQ" does ' + 'not have valid workflows'): pt.add_default_workflow(qdb.user.User('test@foo.bar')) # cleaning diff --git a/qiita_pet/handlers/qiita_redbiom.py b/qiita_pet/handlers/qiita_redbiom.py index a60a8f684..f18d5593e 100644 --- a/qiita_pet/handlers/qiita_redbiom.py +++ b/qiita_pet/handlers/qiita_redbiom.py @@ -56,7 +56,7 @@ def _redbiom_metadata_search(self, query, contexts): 'The query ("%s") did not work and may be malformed. Please ' 'check the search help for more information on the queries.' % query) - if not message: + if not message and redbiom_samples: study_artifacts = defaultdict(lambda: defaultdict(list)) for ctx in contexts: # redbiom.fetch.data_from_samples returns a biom, which we diff --git a/qiita_pet/templates/analysis_selected.html b/qiita_pet/templates/analysis_selected.html index 9543a81b8..5cc5da4ce 100644 --- a/qiita_pet/templates/analysis_selected.html +++ b/qiita_pet/templates/analysis_selected.html @@ -218,7 +218,7 @@
diff --git a/qiita_pet/templates/study_base.html b/qiita_pet/templates/study_base.html index de3bbc1fc..b459eb7bc 100644 --- a/qiita_pet/templates/study_base.html +++ b/qiita_pet/templates/study_base.html @@ -95,7 +95,7 @@ {% if editable %} Upload Files - + {% end %} {% if study_info['show_biom_download_button'] %} All QIIME maps and BIOMs |