Skip to content
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

fix #2030 #2032

Merged
merged 1 commit into from
Dec 28, 2016
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
2 changes: 1 addition & 1 deletion qiita_pet/handlers/api_proxy/studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def study_prep_get_req(study_id, user_id):
info['start_artifact_id'] = start_artifact.id
info['youngest_artifact'] = '%s - %s' % (
youngest_artifact.name, youngest_artifact.artifact_type)
info['ebi_experiment'] = bool(
info['ebi_experiment'] = len(
[v for _, v in viewitems(prep.ebi_experiment_accessions)
if v is not None])
else:
Expand Down
12 changes: 6 additions & 6 deletions qiita_pet/handlers/api_proxy/tests/test_studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ def test_study_prep_get_req(self):
'start_artifact_id': 1,
'start_artifact': 'FASTQ',
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True}, {
'ebi_experiment': 27}, {
'id': 2,
'status': 'private',
'name': 'PREP 2 NAME',
'start_artifact': 'BIOM',
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True,
'ebi_experiment': 27,
'start_artifact_id': 7}]}}
self.assertEqual(obs, exp)

Expand All @@ -200,21 +200,21 @@ def test_study_prep_get_req(self):
'start_artifact_id': 1,
'start_artifact': 'FASTQ',
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True},
'ebi_experiment': 27},
{'id': 2,
'status': 'private',
'name': 'PREP 2 NAME',
'start_artifact_id': 7,
'start_artifact': 'BIOM',
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True}],
'ebi_experiment': 27}],
'16S': [{'id': pt.id,
'status': 'sandbox',
'name': 'PREP %d NAME' % pt.id,
'start_artifact_id': None,
'start_artifact': None,
'youngest_artifact': None,
'ebi_experiment': False}]}}
'ebi_experiment': 0}]}}
self.assertEqual(obs, exp)

obs = study_prep_get_req(1, 'admin@foo.bar')
Expand All @@ -231,7 +231,7 @@ def test_study_prep_get_req(self):
'start_artifact_id': 1,
'start_artifact': 'FASTQ',
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True}]}}
'ebi_experiment': 27}]}}
self.assertEqual(obs, exp)
# Reset visibility of the artifacts
for i in range(4, 0, -1):
Expand Down
6 changes: 3 additions & 3 deletions qiita_pet/templates/study_ajax/data_type_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ <h4 class="panel-title">
<div id="collapse{{cleaned_dt}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{{cleaned_dt}}">
<div class="panel-body">
{% for prep in prep_info[dt] %}
{% if prep['ebi_experiment'] %}
<img src="{% raw qiita_config.portal_dir %}/static/img/ena.png" style="width:20px;height:20px;"> ({{prep['ebi_experiment']}})
{% end %}
<a href="#" style="display:block;color:black;" onclick="populate_main_div('{% raw qiita_config.portal_dir %}/study/description/prep_template/', { prep_id: {{prep['id']}}, study_id: {{study_id}} });">
<span id="prep-header-{{prep['id']}}">
{% if prep['ebi_experiment'] %}
<img src="{% raw qiita_config.portal_dir %}/static/img/ena.png" style="width:20px;height:20px;">
{% end %}
{{prep['name']}} - ID {{prep['id']}} - {{prep['status']}}
</span><br/>
{{prep['start_artifact']}} - ID {{prep['start_artifact_id']}}<br/>
Expand Down