diff options
Diffstat (limited to 'askbot/views/readers.py')
-rw-r--r-- | askbot/views/readers.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/askbot/views/readers.py b/askbot/views/readers.py index 2e3c8249..4327e13a 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -508,15 +508,10 @@ def question(request, id):#refactor - long subroutine. display question body, an #load answers and post id's->athor_id mapping #posts are pre-stuffed with the correctly ordered comments - updated_question_post, answers, post_to_author, published_answer_ids = thread.get_post_data_for_question_view( + question_post, answers, post_to_author, published_answer_ids = thread.get_post_data_for_question_view( sort_method=answer_sort_method, user=request.user ) - question_post.set_cached_comments( - updated_question_post.get_cached_comments() - ) - - #Post.objects.precache_comments(for_posts=[question_post] + answers, visitor=request.user) user_votes = {} user_post_id_list = list() @@ -711,7 +706,13 @@ def get_comment(request): id = int(request.GET['id']) comment = models.Post.objects.get(post_type='comment', id=id) request.user.assert_can_edit_comment(comment) - return {'text': comment.text} + + try: + rev = comment.revisions.get(revision=0) + except models.PostRevision.DoesNotExist: + rev = comment.get_latest_revision() + + return {'text': rev.text} @csrf.csrf_exempt |