~netlandish/django-wiki

9170b06c4248cfa54198f4d554370aabec48f1ec — Peter Sanchez 7 years ago bb9a192
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.
1 files changed, 2 insertions(+), 2 deletions(-)

M wiki/plugins/links/views.py
M wiki/plugins/links/views.py => wiki/plugins/links/views.py +2 -2
@@ 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 []