Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

Fikset en bug i søkeviewet som ikke tålte tom streng.

This commit is contained in:
Øyvind Almelid 2011-03-06 18:12:34 +00:00
parent 58267e9f82
commit f6c1d11277
1 changed files with 4 additions and 1 deletions

View File

@ -72,7 +72,10 @@ def IndexView(request):
return render_to_response('index.html') return render_to_response('index.html')
def SearchView(request): def SearchView(request):
search_string=request.GET['searchterm'] if 'searchterm' in request.GET:
search_string=request.GET['searchterm']
else:
search_string=''
results=search(search_string) results=search(search_string)
return render_to_response('search/search.html',{'search_string' : search_string, 'books' : results[0], 'people' : results[1], 'categories' : results[2]}) return render_to_response('search/search.html',{'search_string' : search_string, 'books' : results[0], 'people' : results[1], 'categories' : results[2]})