X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..96e236bc692fe1449b14739e4be3fdc6c3bd92ce:/src/search/views.py diff --git a/src/search/views.py b/src/search/views.py index 2fe94f431..970734ad7 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -92,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: @@ -179,7 +179,7 @@ def search_books(query): except Book.DoesNotExist: return False - results = filter(ensure_exists, results) + results = [r for r in results if ensure_exists(r)] return results @@ -214,7 +214,7 @@ def search_pictures(query): except Picture.DoesNotExist: return False - results = filter(ensure_exists, results) + results = [r for r in results if ensure_exists(r)] return results