]> git.openstreetmap.org Git - osqa.git/commitdiff
Both auto-complete features, tag and questions were not filtering deleted objects.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 11:16:38 +0000 (11:16 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 11:16:38 +0000 (11:16 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@326 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/commands.py

index 92e985796e25900c834414142b2b9751d7d855e9..40d61ec07959a32544b724e582d44659c229aad4 100644 (file)
@@ -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()