From 4ea67e917a56675d74833257c69f39981f460238 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 23:25:00 +0200 Subject: [PATCH] rly nigga --- drama/helpers/get.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drama/helpers/get.py b/drama/helpers/get.py index 8506b9ff1..0eb2656f0 100644 --- a/drama/helpers/get.py +++ b/drama/helpers/get.py @@ -434,21 +434,16 @@ def get_comments(cids, v=None, sort="new", isouter=True ).filter( Comment.id.in_(cids) - ) + ).order_by(Comment.id).all() - output = [x[0] for x in query.all()] - for i in range(len(output)): - output[i]._voted = comments[i][1].vote_type if comments[i][1] else 0 + output = [x[0] for x in query] + for i in range(len(output)): output[i]._voted = query[i][1].vote_type if query[i][1] else 0 else: - output = g.db.query(Comment).options().filter(Comment.id.in_(cids)).all() - for i in range(len(output)): - output[i]._is_exiled_for=comments[i][1] + output = g.db.query(Comment).options().filter(Comment.id.in_(cids)).order_by(Comment.id).all() - output = sorted(output, key=lambda x: cids.index(x.id)) - return output