diff --git a/board/templates/board/post_detail.html b/board/templates/board/post_detail.html index 0a0b1a2..63a17b2 100644 --- a/board/templates/board/post_detail.html +++ b/board/templates/board/post_detail.html @@ -44,7 +44,7 @@ {# posts #}
{% include "board/post_snippet.html" %} - {% for post in post.replies.all %} + {% for post in replies %}
{% include "board/post_snippet.html" %}
diff --git a/board/views.py b/board/views.py index bc606cb..b6cde9d 100644 --- a/board/views.py +++ b/board/views.py @@ -240,7 +240,9 @@ class PostView(TemplateView): def get_context_data(self, **kwargs): kwargs["board"] = self.board post_id = self.kwargs["id"] - kwargs["post"] = get_object_or_404(Post, id=post_id) + post = get_object_or_404(Post, id=post_id) + kwargs["post"] = post + kwargs["replies"] = post.replies.all().order_by("id") kwargs["max_upload_size"] = settings.MAX_UPLOAD_SIZE return super(PostView, self).get_context_data(**kwargs)