diff --git a/python/web/library/views.py b/python/web/library/views.py index fe91c50..20005ac 100644 --- a/python/web/library/views.py +++ b/python/web/library/views.py @@ -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]})