X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/cafe0a541b6349de15c0444bddf9493d8aa71df8..228a95a4c642fcba201dd2fe450fdbcdd068a5d1:/forum/views/commands.py diff --git a/forum/views/commands.py b/forum/views/commands.py index ed72bd1..3c49076 100644 --- a/forum/views/commands.py +++ b/forum/views/commands.py @@ -480,10 +480,10 @@ def matching_tags(request): def related_questions(request): if request.POST and request.POST.get('title', None): + can_rank, questions = Question.objects.search(request.POST['title']) return HttpResponse(simplejson.dumps( [dict(title=q.title, url=q.get_absolute_url(), score=q.score, summary=q.summary) - for q in Question.objects.search(request.POST['title']).filter_state(deleted=False)[0:10]]), - mimetype="application/json") + for q in questions.filter_state(deleted=False)[0:10]]), mimetype="application/json") else: raise Http404()