Skip to content

Commit 6de1e1d

Browse files
authored
fix #3072 (#3074)
* fix #3072 * flake8
1 parent 6e4894c commit 6de1e1d

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

qiita_db/test/test_util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,12 @@ def test_get_artifacts_information(self):
10281028
'prep_samples': 27, 'platform': 'Illumina',
10291029
'target_gene': '16S rRNA', 'name': 'BIOM', 'data_type': '16S',
10301030
'parameters': {}, 'algorithm': '', 'algorithm_az': '',
1031-
'deprecated': None, 'active': None, 'files': ['biom_table.biom']},
1031+
'deprecated': False, 'active': True,
1032+
'files': ['biom_table.biom']},
10321033
{'artifact_id': 8, 'target_subfragment': [], 'prep_samples': 0,
10331034
'platform': 'not provided', 'target_gene': 'not provided', 'name':
10341035
'noname', 'data_type': '18S', 'parameters': {}, 'algorithm': '',
1035-
'algorithm_az': '', 'deprecated': None, 'active': None,
1036+
'algorithm_az': '', 'deprecated': False, 'active': True,
10361037
'files': ['biom_table.biom']}]
10371038
self.assertCountEqual(obs, exp)
10381039
exp = exp[1:]

qiita_db/util.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,10 +1756,6 @@ def get_artifacts_information(artifact_ids, only_biom=True):
17561756

17571757
# generating algorithm, by default is ''
17581758
algorithm = ''
1759-
# set to False because if there is no cid, it means that it
1760-
# was a direct upload
1761-
deprecated = None
1762-
active = None
17631759
if cid is not None:
17641760
deprecated = commands[cid]['deprecated']
17651761
active = commands[cid]['active']
@@ -1777,6 +1773,11 @@ def get_artifacts_information(artifact_ids, only_biom=True):
17771773
if algorithm not in algorithm_az:
17781774
algorithm_az[algorithm] = hashlib.md5(
17791775
algorithm.encode('utf-8')).hexdigest()
1776+
else:
1777+
# there is no cid, thus is a direct upload; setting things
1778+
# like this so the artifacts are dispayed
1779+
deprecated = False
1780+
active = True
17801781

17811782
if prep_template_id not in ts:
17821783
qdb.sql_connection.TRN.add(sql_ts, [prep_template_id])

qiita_pet/handlers/api_proxy/tests/test_artifact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ def test_artifact_get_info(self):
218218
'prep_samples': 27},
219219
{'files': ['biom_table.biom'], 'artifact_id': 7,
220220
'data_type': '16S',
221-
'timestamp': '2012-10-02 17:30:00', 'active': None,
221+
'timestamp': '2012-10-02 17:30:00', 'active': True,
222222
'target_gene': '16S rRNA', 'name': 'BIOM',
223223
'target_subfragment': ['V4'], 'parameters': {}, 'algorithm': '',
224-
'deprecated': None, 'platform': 'Illumina', 'algorithm_az': '',
224+
'deprecated': False, 'platform': 'Illumina', 'algorithm_az': '',
225225
'prep_samples': 27}]
226226
exp = {'status': 'success', 'msg': '', 'data': data}
227227
self.assertCountEqual(list(obs.keys()), exp.keys())

qiita_pet/handlers/study_handlers/tests/test_artifact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_post(self):
177177
'artifact_id': 7,
178178
'data_type': '16S', 'timestamp': '2012-10-02 17:30:00',
179179
'prep_samples': 27, 'platform': 'Illumina', 'algorithm_az': '',
180-
'deprecated': None, 'active': None, 'algorithm': '',
180+
'deprecated': False, 'active': True, 'algorithm': '',
181181
'parameters': {}, 'target_gene': '16S rRNA', 'name': 'BIOM'}]
182182
exp = {'status': 'success', 'msg': '', 'data': data}
183183
obs = loads(response.body)

0 commit comments

Comments
 (0)