]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/commands.py
use read-only textarea instead of text input for the answer link prompt
[osqa.git] / forum / views / commands.py
index 0b5412686d2ae558961d2d859fc49bc06c4c8176..f34619a4c1437db21f4597b2f40cb5524daf758e 100644 (file)
@@ -534,6 +534,10 @@ def matching_users(request):
 def related_questions(request):
     if request.POST and request.POST.get('title', None):
         can_rank, questions = Question.objects.search(request.POST['title'])
+
+        if can_rank and isinstance(can_rank, basestring):
+            questions = questions.order_by(can_rank)
+
         return HttpResponse(simplejson.dumps(
                 [dict(title=q.title, url=q.get_absolute_url(), score=q.score, summary=q.summary)
                  for q in questions.filter_state(deleted=False)[0:10]]), mimetype="application/json")