Skip to content

Commit d57bd97

Browse files
committed
addressing @josenavas suggestions
1 parent 11e71a5 commit d57bd97

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

qiita_pet/handlers/analysis_handlers.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,16 @@ def get(self, analysis_id):
143143
jobject.results))
144144

145145
dropped_samples = analysis.dropped_samples
146-
dropped = {}
146+
dropped = defaultdict(list)
147147
if dropped_samples:
148148
for proc_data_id, samples in viewitems(analysis.dropped_samples):
149149
if not samples:
150150
continue
151151
proc_data = ProcessedData(proc_data_id)
152152
data_type = proc_data.data_type()
153153
study = proc_data.study
154-
if data_type not in dropped:
155-
dropped[data_type] = []
156-
dropped[data_type].append({'study': Study(study).title,
157-
'samples': samples})
154+
dropped[data_type].append((Study(study).title, len(samples),
155+
', '.join(samples)))
158156

159157
self.render("analysis_results.html",
160158
jobres=jobres, aname=analysis.name, dropped=dropped,

qiita_pet/templates/analysis_results.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ <h3 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href=
2828
{% for data_type, studies in viewitems(dropped) %}
2929
<b><u>{{data_type}}</u></b>
3030
<br/><br/>
31-
{% for s in studies %}
32-
<b>{{s['study']}}:</b>
31+
{% for title, num_samples, samples in studies %}
32+
<b>{{title}}:</b>
3333
<br/>
34-
Total dropped: {{len(s['samples'])}}
34+
Total dropped: {{num_samples}}
3535
<br/>
36-
{{', '.join(s['samples'])}}<br/>
36+
{{samples}}<br/>
3737
{% end %}
3838
<hr>
3939
{% end %}

0 commit comments

Comments
 (0)