From a1bc18f6234dc6f4a5bc5834e5e4e33f4cea8654 Mon Sep 17 00:00:00 2001 From: Tomasz Zielinski Date: Mon, 9 Jan 2012 19:28:41 +0100 Subject: Added comment to question view --- askbot/views/readers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/askbot/views/readers.py b/askbot/views/readers.py index 5ec4e336..38db0bac 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -475,6 +475,9 @@ def question(request, id):#refactor - long subroutine. display question body, an answers = answers.order_by({"latest":"-added_at", "oldest":"added_at", "votes":"-score" }[answer_sort_method]) answers = list(answers) + # TODO: Add unit test to catch the bug where precache_comments() is called above (before) reordering the accepted answer to the top + #Post.objects.precache_comments(for_posts=[question_post] + answers, visitor=request.user) + if thread.accepted_answer: # Put the accepted answer to front answers.remove(thread.accepted_answer) answers.insert(0, thread.accepted_answer) -- cgit v1.2.3-1-g7c22