X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c9c3cb4c714911710f606f8dc47d5e65707aff67..43ce98844279dacea6c81d671e275063540e4992:/forum/views/readers.py?ds=sidebyside diff --git a/forum/views/readers.py b/forum/views/readers.py index b61e3e9..8e641bf 100644 --- a/forum/views/readers.py +++ b/forum/views/readers.py @@ -223,7 +223,7 @@ def tags(request): if request.method == "GET": stag = request.GET.get("q", "").strip() if stag: - tags = tags.filter(name__contains=stag) + tags = tags.filter(name__icontains=stag) return pagination.paginated(request, ('tags', TagPaginatorContext()), { "tags" : tags, @@ -243,7 +243,7 @@ def update_question_view_times(request, question): request.session['last_seen_in_question'][question.id] = datetime.datetime.now() -def match_question_slug(slug): +def match_question_slug(id, slug): slug_words = slug.split('-') qs = Question.objects.filter(title__istartswith=slug_words[0]) @@ -287,7 +287,7 @@ def question(request, id, slug='', answer=None): question = Question.objects.get(id=id) except: if slug: - question = match_question_slug(slug) + question = match_question_slug(id, slug) if question is not None: return HttpResponseRedirect(question.get_absolute_url())