Fix post ordering in reply view

I think this was database-specific. Replies should now be ordered by
their ID.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-18 19:10:04 -07:00
parent 0847ea310c
commit 08b4fe0086
2 changed files with 4 additions and 2 deletions

View File

@@ -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)