From f6c1d11277791e1af97314a803e2bfc9dba235bd Mon Sep 17 00:00:00 2001 From: almelid Date: Sun, 6 Mar 2011 18:12:34 +0000 Subject: [PATCH] =?UTF-8?q?Fikset=20en=20bug=20i=20s=C3=B8keviewet=20som?= =?UTF-8?q?=20ikke=20t=C3=A5lte=20tom=20streng.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/web/library/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]})