Add findable flag.
[wolnelektury.git] / src / search / views.py
index 3bbe720..4d792e4 100644 (file)
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
@@ -93,7 +92,7 @@ def hint(request):
                 'id': b.id,
                 'url': b.get_absolute_url()
             }
-            for b in Book.objects.filter(title__iregex='\m' + prefix)[:limit-len(data)]
+            for b in Book.objects.filter(findable=True, title__iregex='\m' + prefix)[:limit-len(data)]
         ]
     callback = request.GET.get('callback', None)
     if callback:
@@ -119,7 +118,7 @@ def main(request):
     pd_authors = search_pd_authors(query)
     books = search_books(query)
     pictures = search_pictures(query)
-    suggestion = u''
+    suggestion = ''
 
     if not (books or pictures or pd_authors):
         form = PublishingSuggestForm(initial={"books": query + ", "})