From: Jan Szejko Date: Fri, 16 Mar 2018 13:28:59 +0000 (+0100) Subject: disable search X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/53e53be2fd5c6ffd0b96928735944aa75b7b2f2d?ds=inline disable search --- diff --git a/src/opds/views.py b/src/opds/views.py index 189ff0f5a..a96bfb341 100644 --- a/src/opds/views.py +++ b/src/opds/views.py @@ -10,7 +10,7 @@ from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.utils.feedgenerator import Atom1Feed from django.conf import settings -from django.http import Http404 +from django.http import Http404, HttpResponse from django.contrib.sites.models import Site from django.utils.functional import lazy @@ -361,6 +361,9 @@ class SearchFeed(AcquisitionFeed): ATOM_PLACEHOLDER = re.compile(r"^{(atom|opds):\w+}$") + def __call__(self, *args, **kwargs): + return HttpResponse('Search is temporarily disabled', status=503) + def get_object(self, request): """ For OPDS 1.1 We should handle a query for search terms diff --git a/src/search/views.py b/src/search/views.py index e6efc21bd..6120d25fe 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -106,6 +106,7 @@ def hint(request): @cache.never_cache def main(request): + return HttpResponse('Search is temporarily disabled', status=503) query = request.GET.get('q', '') if len(query) < 2: return render_to_response( diff --git a/src/wolnelektury/templates/base/superbase.html b/src/wolnelektury/templates/base/superbase.html index 54c72405a..85af1f2bf 100644 --- a/src/wolnelektury/templates/base/superbase.html +++ b/src/wolnelektury/templates/base/superbase.html @@ -126,11 +126,14 @@
+ {% comment %}
{{ search_form.q }}
+ {% endcomment %} + Wyszukiwanie jest tymczasowo wyłączone. Search is temporarily disabled.