diff --git a/signbank/dictionary/adminviews.py b/signbank/dictionary/adminviews.py index 57320e70..f4bb9c74 100755 --- a/signbank/dictionary/adminviews.py +++ b/signbank/dictionary/adminviews.py @@ -6594,7 +6594,11 @@ def get_queryset(self): if 'search_results' in self.request.session.keys(): search_results = self.request.session['search_results'] if len(search_results) > 0: - if search_results[0]['href_type'] not in ['gloss']: + first_search_result = search_results[0] + first_gloss = Gloss.objects.filter(id__in=[first_search_result['id']]).first() + if first_search_result['href_type'] not in ['gloss']: + search_results = [] + if not first_gloss or first_gloss.lemma.dataset not in selected_datasets: search_results = [] else: search_results = [] @@ -6608,6 +6612,9 @@ def get_queryset(self): if not get: return glosses_of_dataset + if not glosses_of_dataset: + return glosses_of_dataset + # data structure to store the query parameters in order to keep them in the form query_parameters = dict() diff --git a/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html b/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html index 4b64252f..c79bfe85 100644 --- a/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html +++ b/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html @@ -305,7 +305,13 @@

{% trans "Batch Edit" %}

-{% trans "No glosses found. Please construct a new query:" %} + {% trans "Search" %}

+{% else %} +
@@ -315,7 +321,6 @@

{% trans "Batch Edit" %}

- {% load underscore_to_space %} {% for gloss in object_list %}
@@ -719,6 +724,7 @@

{% trans "Batch Edit" %}

{% endfor %}
+{% endif %}