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:
@@ -44,7 +44,7 @@
|
|||||||
{# posts #}
|
{# posts #}
|
||||||
<div class="row thread">
|
<div class="row thread">
|
||||||
{% include "board/post_snippet.html" %}
|
{% include "board/post_snippet.html" %}
|
||||||
{% for post in post.replies.all %}
|
{% for post in replies %}
|
||||||
<div class="row reply">
|
<div class="row reply">
|
||||||
{% include "board/post_snippet.html" %}
|
{% include "board/post_snippet.html" %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -240,7 +240,9 @@ class PostView(TemplateView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
kwargs["board"] = self.board
|
kwargs["board"] = self.board
|
||||||
post_id = self.kwargs["id"]
|
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
|
kwargs["max_upload_size"] = settings.MAX_UPLOAD_SIZE
|
||||||
return super(PostView, self).get_context_data(**kwargs)
|
return super(PostView, self).get_context_data(**kwargs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user