This commit is contained in:
Aevann1 2021-08-06 14:22:29 +02:00
parent e69a679965
commit b60cc38f5c
7 changed files with 49 additions and 25 deletions

View file

@ -106,9 +106,9 @@ def post_id(pid, anything=None, v=None):
)
if sort == "top":
comments = comms.order_by(Comment.score.desc()).all()
comments = sorted(comms.all(), key=lambda x: x[0].score, reverse=True)
elif sort == "bottom":
comments = comms.order_by(Comment.score.asc()).all()
comments = sorted(comms.all(), key=lambda x: x[0].score)
elif sort == "new":
comments = comms.order_by(Comment.created_utc.desc()).all()
elif sort == "old":
@ -140,9 +140,9 @@ def post_id(pid, anything=None, v=None):
)
if sort == "top":
comments = comms.order_by(Comment.score.desc()).all()
comments = sorted(comms.all(), key=lambda x: x.score, reverse=True)
elif sort == "bottom":
comments = comms.order_by(Comment.score.asc()).all()
comments = sorted(comms.all(), key=lambda x: x.score)
elif sort == "new":
comments = comms.order_by(Comment.created_utc.desc()).all()
elif sort == "old":