Skip to content
Snippets Groups Projects
Commit 5d4880c6 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Fix syntax error in tsquery in search view by cleaning search query string.

parent 0f538a17
No related branches found
No related tags found
No related merge requests found
import re
from django.conf import settings
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http import Http404
......@@ -17,6 +19,10 @@ def search(request):
# Search
if search_query:
# Allow only word characters and spaces in search query.
words = re.findall('\w+', search_query.strip())
search_query = ' '.join(words)
public_site = request.site.root_page
search_results = Page.objects.live().descendant_of(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment