forked from rDrama/rDrama
fix comment sorting
parent
bbe2851c2c
commit
91fe866f47
|
@ -30,10 +30,8 @@ def sort_comments(sort, comments):
|
||||||
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.upvotes - Comment.downvotes)
|
return comments.order_by(Comment.upvotes - Comment.downvotes)
|
||||||
elif SITE == 'watchpeopledie.co':
|
|
||||||
return comments.order_by(Comment.downvotes - Comment.upvotes, Comment.id.desc())
|
|
||||||
else:
|
else:
|
||||||
return comments.order_by(Comment.realupvotes.desc(), Comment.id.desc())
|
return comments.order_by(Comment.downvotes - Comment.upvotes, Comment.id.desc())
|
||||||
|
|
||||||
def sort_posts(sort, posts):
|
def sort_posts(sort, posts):
|
||||||
if sort == "new":
|
if sort == "new":
|
||||||
|
|
Loading…
Reference in New Issue