Skip to content

Commit 0944895

Browse files
authored
Merge pull request #71 from Eeeeelias/error-messaging
Improve error messaging
2 parents 7c9dbf5 + 2573ac1 commit 0944895

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

container/domain/templates/visualization/multiple_queries.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@
9393
<div class="col-lg-10">
9494
<!-- Tab content -->
9595
<div class="tab-content" id="v-pills-tabContent">
96-
96+
97+
{% if not_found|length > 0 %}
98+
<div class="alert alert-warning my-3">Some queries could not be found in our database: {{ not_found|join:", " }}.</div>
99+
{% endif %}
100+
97101
<!-- Queries tab -->
98102
<div class="tab-pane fade card shadow rounded {% if not show_network %} show active pepe {% endif %}"
99103
id="v-pills-queries" role="tabpanel">

container/domain/views.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,17 @@ def multiple_queries(request, inputs, organism):
8282
continue
8383

8484
matches = 0
85+
not_found = []
86+
filtered_table = {}
8587
for query in transcript_table.keys():
8688
if len(transcript_table[query]) > 0:
8789
matches += 1
90+
filtered_table[query] = transcript_table[query]
91+
else:
92+
# remove the query from the transcript table
93+
not_found.append(query.strip())
94+
95+
transcript_table = filtered_table
8896

8997
if matches == 0:
9098
origin = request.GET.get('origin', None)
@@ -130,7 +138,8 @@ def multiple_queries(request, inputs, organism):
130138
'trans_table': transcript_table,
131139
'combined_nodes': combined_nodes,
132140
'combined_edges': combined_edges,
133-
'switch': []
141+
'switch': [],
142+
'not_found': not_found,
134143
}
135144

136145
return render(request, 'visualization/multiple_queries.html', context)

0 commit comments

Comments
 (0)