Fixed bug when tags_starting_with view was called without q query param.
authorMarek Stępniowski <marek@stepniowski.com>
Tue, 7 Oct 2008 10:58:45 +0000 (12:58 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Tue, 7 Oct 2008 10:58:45 +0000 (12:58 +0200)
apps/catalogue/views.py

index c9d6ab2..f284e0a 100644 (file)
@@ -157,7 +157,7 @@ def search(request):
 
 
 def tags_starting_with(request):
 
 
 def tags_starting_with(request):
-    prefix = request.GET['q']
+    prefix = request.GET.get('q', '')
     # Prefix must have at least 2 characters
     if len(prefix) < 2:
         return HttpResponse('')
     # Prefix must have at least 2 characters
     if len(prefix) < 2:
         return HttpResponse('')