Skip to content

Commit 2ed031e

Browse files
committed
fix SelectedSamplesHandler.get
1 parent 0022064 commit 2ed031e

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

qiita_db/software.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class Command(qdb.base.QiitaObject):
5151
-------------
5252
create
5353
exists
54-
get_commands_by_input_type(cls, artifact_types, active_only=True,
55-
get_html_generator(cls, artifact_type):
56-
get_validator(cls, artifact_type):
54+
get_commands_by_input_type
55+
get_html_generator
56+
get_validator
5757
5858
See Also
5959
--------

qiita_pet/handlers/analysis_handlers/listing_handlers.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ def get(self):
118118

119119
# finding common metadata fields
120120
metadata = analysis.metadata_categories
121-
common = []
121+
common = {'sample': set(), 'prep': set()}
122122
for i, (_, m) in enumerate(metadata.items()):
123-
if i == 0:
124-
common = {'sample': set(m['sample']), 'prep': set(m['prep'])}
125-
else:
126-
common['sample'] = common['sample'] & set(m['sample'])
127-
common['prep'] = common['prep'] & set(m['prep'])
123+
svals = set(m['sample'])
124+
pvals = set(m['prep'])
125+
if i != 0:
126+
svals = common['sample'] & svals
127+
pvals = common['prep'] & pvals
128+
common['sample'] = svals
129+
common['prep'] = pvals
128130

129131
self.render("analysis_selected.html", sel_data=sel_data,
130132
proc_info=proc_data_info, metadata=metadata, common=common)

qiita_pet/templates/analysis_selected.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,8 @@
6363
$('#clear-button').on('click', clear);
6464
{% if sel_data %}$('#no-selected').hide(){% end %}
6565

66-
{% if 'common' in locals() %}
67-
var common_sample_fields = {% raw list(common['sample']) %};
68-
var common_prep_fields = {% raw list(common['prep']) %};
69-
{% else %}
70-
var common_sample_fields = [];
71-
var common_prep_fields = [];
72-
{% end %}
66+
var common_sample_fields = {% raw list(common['sample']) %};
67+
var common_prep_fields = {% raw list(common['prep']) %};
7368

7469
$.each($(".chosen-select"), function (_, element){
7570
var is_sample = element.id.startsWith('sample-metadata');

0 commit comments

Comments
 (0)