diff --git a/qiita_pet/handlers/analysis_handlers/base_handlers.py b/qiita_pet/handlers/analysis_handlers/base_handlers.py index a063d64f8..782d24f27 100644 --- a/qiita_pet/handlers/analysis_handlers/base_handlers.py +++ b/qiita_pet/handlers/analysis_handlers/base_handlers.py @@ -74,9 +74,10 @@ def analysis_description_handler_get_request(analysis_id, user): artifacts = {} for aid, samples in analysis.samples.items(): artifact = Artifact(aid) + prep_ids = set([str(x.id) for x in artifact.prep_templates]) study = artifact.study artifacts[aid] = ( - study.id, study.title, artifact.merging_scheme, samples) + study.id, study.title, artifact.merging_scheme, samples, prep_ids) return {'analysis_name': analysis.name, 'analysis_id': analysis.id, diff --git a/qiita_pet/handlers/analysis_handlers/tests/test_base_handlers.py b/qiita_pet/handlers/analysis_handlers/tests/test_base_handlers.py index ee30f1b91..a72c3c848 100644 --- a/qiita_pet/handlers/analysis_handlers/tests/test_base_handlers.py +++ b/qiita_pet/handlers/analysis_handlers/tests/test_base_handlers.py @@ -45,18 +45,19 @@ def test_analysis_description_handler_get_request(self): 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192']), + '1.SKM4.640180', '1.SKM9.640192'], {'1'}), 5: (1, 'Identification of the Microbiomes for Cannabis ' 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192']), + '1.SKM4.640180', '1.SKM9.640192'], {'1'}), 6: (1, 'Identification of the Microbiomes for Cannabis ' 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192'])}, + '1.SKM4.640180', '1.SKM9.640192'], {'1'})}, 'alert_msg': ''} + self.assertEqual(obs, exp) r_client.set('analysis_1', dumps({'job_id': 'job_id'})) @@ -73,17 +74,17 @@ def test_analysis_description_handler_get_request(self): 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192']), + '1.SKM4.640180', '1.SKM9.640192'], {'1'}), 5: (1, 'Identification of the Microbiomes for Cannabis ' 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192']), + '1.SKM4.640180', '1.SKM9.640192'], {'1'}), 6: (1, 'Identification of the Microbiomes for Cannabis ' 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192'])}, + '1.SKM4.640180', '1.SKM9.640192'], {'1'})}, 'alert_msg': 'An artifact is being deleted from this analysis'} self.assertEqual(obs, exp) @@ -103,17 +104,17 @@ def test_analysis_description_handler_get_request(self): 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192']), + '1.SKM4.640180', '1.SKM9.640192'], {'1'}), 5: (1, 'Identification of the Microbiomes for Cannabis ' 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192']), + '1.SKM4.640180', '1.SKM9.640192'], {'1'}), 6: (1, 'Identification of the Microbiomes for Cannabis ' 'Soils', ('Pick closed-reference OTUs | Split ' 'libraries FASTQ', 'QIIME v1.9.1'), [ '1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184', - '1.SKM4.640180', '1.SKM9.640192'])}, + '1.SKM4.640180', '1.SKM9.640192'], {'1'})}, 'alert_msg': 'Error deleting artifact'} self.assertEqual(obs, exp) diff --git a/qiita_pet/templates/analysis_description.html b/qiita_pet/templates/analysis_description.html index cf9f611c0..e3e966869 100644 --- a/qiita_pet/templates/analysis_description.html +++ b/qiita_pet/templates/analysis_description.html @@ -66,6 +66,7 @@