Skip to content

fix #3072 #3074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions qiita_db/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,11 +1028,12 @@ def test_get_artifacts_information(self):
'prep_samples': 27, 'platform': 'Illumina',
'target_gene': '16S rRNA', 'name': 'BIOM', 'data_type': '16S',
'parameters': {}, 'algorithm': '', 'algorithm_az': '',
'deprecated': None, 'active': None, 'files': ['biom_table.biom']},
'deprecated': False, 'active': True,
'files': ['biom_table.biom']},
{'artifact_id': 8, 'target_subfragment': [], 'prep_samples': 0,
'platform': 'not provided', 'target_gene': 'not provided', 'name':
'noname', 'data_type': '18S', 'parameters': {}, 'algorithm': '',
'algorithm_az': '', 'deprecated': None, 'active': None,
'algorithm_az': '', 'deprecated': False, 'active': True,
'files': ['biom_table.biom']}]
self.assertCountEqual(obs, exp)
exp = exp[1:]
Expand Down
9 changes: 5 additions & 4 deletions qiita_db/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1756,10 +1756,6 @@ def get_artifacts_information(artifact_ids, only_biom=True):

# generating algorithm, by default is ''
algorithm = ''
# set to False because if there is no cid, it means that it
# was a direct upload
deprecated = None
active = None
if cid is not None:
deprecated = commands[cid]['deprecated']
active = commands[cid]['active']
Expand All @@ -1777,6 +1773,11 @@ def get_artifacts_information(artifact_ids, only_biom=True):
if algorithm not in algorithm_az:
algorithm_az[algorithm] = hashlib.md5(
algorithm.encode('utf-8')).hexdigest()
else:
# there is no cid, thus is a direct upload; setting things
# like this so the artifacts are dispayed
deprecated = False
active = True

if prep_template_id not in ts:
qdb.sql_connection.TRN.add(sql_ts, [prep_template_id])
Expand Down
4 changes: 2 additions & 2 deletions qiita_pet/handlers/api_proxy/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ def test_artifact_get_info(self):
'prep_samples': 27},
{'files': ['biom_table.biom'], 'artifact_id': 7,
'data_type': '16S',
'timestamp': '2012-10-02 17:30:00', 'active': None,
'timestamp': '2012-10-02 17:30:00', 'active': True,
'target_gene': '16S rRNA', 'name': 'BIOM',
'target_subfragment': ['V4'], 'parameters': {}, 'algorithm': '',
'deprecated': None, 'platform': 'Illumina', 'algorithm_az': '',
'deprecated': False, 'platform': 'Illumina', 'algorithm_az': '',
'prep_samples': 27}]
exp = {'status': 'success', 'msg': '', 'data': data}
self.assertCountEqual(list(obs.keys()), exp.keys())
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/handlers/study_handlers/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_post(self):
'artifact_id': 7,
'data_type': '16S', 'timestamp': '2012-10-02 17:30:00',
'prep_samples': 27, 'platform': 'Illumina', 'algorithm_az': '',
'deprecated': None, 'active': None, 'algorithm': '',
'deprecated': False, 'active': True, 'algorithm': '',
'parameters': {}, 'target_gene': '16S rRNA', 'name': 'BIOM'}]
exp = {'status': 'success', 'msg': '', 'data': data}
obs = loads(response.body)
Expand Down