From 9170b06c4248cfa54198f4d554370aabec48f1ec Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Sat, 8 Apr 2017 10:25:20 -0700 Subject: [PATCH] Making query case insensitive Query was currently case sensitive. Annoying. Also, it was stripping the final forward slash, which just results in a redirect with the forward slash back. Also annoying. --- wiki/plugins/links/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/plugins/links/views.py b/wiki/plugins/links/views.py index d5b6d566..84312155 100644 --- a/wiki/plugins/links/views.py +++ b/wiki/plugins/links/views.py @@ -20,12 +20,12 @@ class QueryUrlPath(View): if query: matches = models.URLPath.objects.can_read( request.user).active().filter( - article__current_revision__title__contains=query, + article__current_revision__title__icontains=query, article__current_revision__deleted=False, ) matches = matches.select_related_common() return [("[%s](wiki:%s)") % (m.article.current_revision.title, '/' + - m.path.strip("/")) for m in matches[:max_num]] + m.path) for m in matches[:max_num]] return [] -- 2.45.2