Show a blank result list when submit thing a blank query

This commit is contained in:
Roberto Rosario
2011-04-19 20:20:44 -04:00
parent f12ff22a84
commit 4a0b9193c9
2 changed files with 7 additions and 4 deletions

View File

@@ -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 %}

View File

@@ -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,