summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zielinski <tomasz.zielinski@pyconsultant.eu>2012-01-09 19:28:41 +0100
committerTomasz Zielinski <tomasz.zielinski@pyconsultant.eu>2012-01-09 19:28:41 +0100
commita1bc18f6234dc6f4a5bc5834e5e4e33f4cea8654 (patch)
treee7d9004fb24f1bd6d5832dcf28cd9a9f06477766
parente4d54d3cfdbcc6952e49928a14eb2757cdeb4a01 (diff)
downloadaskbot-a1bc18f6234dc6f4a5bc5834e5e4e33f4cea8654.tar.gz
askbot-a1bc18f6234dc6f4a5bc5834e5e4e33f4cea8654.tar.bz2
askbot-a1bc18f6234dc6f4a5bc5834e5e4e33f4cea8654.zip
Added comment to question view
-rw-r--r--askbot/views/readers.py3
1 files changed, 3 insertions, 0 deletions
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)