forked from MarseyWorld/MarseyWorld
fix sorting by bottom for comments
parent
81243b48dd
commit
b450d5bb8c
|
@ -36,7 +36,7 @@ def sort_comments(sort, comments):
|
||||||
elif sort == 'controversial':
|
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())
|
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":
|
elif sort == "bottom":
|
||||||
return comments.order_by(Comment.realupvotes, Comment.id.desc())
|
return comments.order_by(Comment.upvotes - Comment.downvotes)
|
||||||
else:
|
else:
|
||||||
return comments.order_by(Comment.realupvotes.desc(), Comment.id.desc())
|
return comments.order_by(Comment.realupvotes.desc(), Comment.id.desc())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue