From b450d5bb8c8217ea637214f6cb7988e92cc18358 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 26 Jun 2022 08:16:05 +0200 Subject: [PATCH] fix sorting by bottom for comments --- files/classes/comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 5cab274e1..26c0816d4 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -36,7 +36,7 @@ def sort_comments(sort, comments): elif sort == 'controversial': return comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc(), Comment.id.desc()) elif sort == "bottom": - return comments.order_by(Comment.realupvotes, Comment.id.desc()) + return comments.order_by(Comment.upvotes - Comment.downvotes) else: return comments.order_by(Comment.realupvotes.desc(), Comment.id.desc())