Fikset en bug i søkeviewet som ikke tålte tom streng.
This commit is contained in:
parent
58267e9f82
commit
f6c1d11277
|
@ -72,7 +72,10 @@ def IndexView(request):
|
|||
return render_to_response('index.html')
|
||||
|
||||
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)
|
||||
return render_to_response('search/search.html',{'search_string' : search_string, 'books' : results[0], 'people' : results[1], 'categories' : results[2]})
|
||||
|
||||
|
|
Reference in New Issue