From d806c871a8829172d645cea7d0cf5896cf5a37d4 Mon Sep 17 00:00:00 2001 From: hernani Date: Tue, 25 May 2010 11:16:38 +0000 Subject: [PATCH 1/1] Both auto-complete features, tag and questions were not filtering deleted objects. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@326 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/views/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forum/views/commands.py b/forum/views/commands.py index 92e9857..40d61ec 100644 --- a/forum/views/commands.py +++ b/forum/views/commands.py @@ -461,7 +461,7 @@ def matching_tags(request): if len(request.GET['q']) == 0: raise CommandException(_("Invalid request")) - possible_tags = Tag.objects.filter(name__istartswith = request.GET['q']) + possible_tags = Tag.active.filter(name__istartswith = request.GET['q']) tag_output = '' for tag in possible_tags: tag_output += (tag.name + "|" + tag.name + "." + tag.used_count.__str__() + "\n") @@ -472,7 +472,7 @@ def related_questions(request): if request.POST and request.POST.get('title', None): 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'])[0:10]]), mimetype="application/json") + for q in Question.objects.search(request.POST['title']).filter_state(deleted=False)[0:10]]), mimetype="application/json") else: raise Http404() -- 2.39.5