From 4a0b9193c9ddbcd1977f05e3537cf3be9bc9a68d Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 19 Apr 2011 20:20:44 -0400 Subject: [PATCH] Show a blank result list when submit thing a blank query --- apps/dynamic_search/templates/search_results.html | 4 +--- apps/dynamic_search/views.py | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/dynamic_search/templates/search_results.html b/apps/dynamic_search/templates/search_results.html index 8f3d4f3d5b..e0c0740912 100644 --- a/apps/dynamic_search/templates/search_results.html +++ b/apps/dynamic_search/templates/search_results.html @@ -7,9 +7,7 @@ {% include "search_results_subtemplate.html" %} {% endif %} - {% if query_string %} - {% include "generic_list_subtemplate.html" %} - {% endif %} + {% include "generic_list_subtemplate.html" %} {% endblock %} {% block footer %} diff --git a/apps/dynamic_search/views.py b/apps/dynamic_search/views.py index ad135057a2..32455e22a6 100644 --- a/apps/dynamic_search/views.py +++ b/apps/dynamic_search/views.py @@ -9,7 +9,6 @@ from api import perform_search from forms import SearchForm from conf.settings import SHOW_OBJECT_TYPE - def results(request, form=None): query_string = '' context = {} @@ -37,6 +36,12 @@ def results(request, form=None): raise elif request.user.is_staff or request.user.is_superuser: messages.error(request, _(u'Search error: %s') % e) + else: + context.update({ + 'found_entries': [], + 'object_list':[], + 'title':_(u'results'), + }) context.update({ 'query_string':query_string,