From 308e9cbbd64dd5bd57038fe4309fe15e3b9b0d0b Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 27 Oct 2022 19:37:54 -0500 Subject: [PATCH] get: remove weird vestigal load_parent part of get_comment --- files/helpers/get.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/files/helpers/get.py b/files/helpers/get.py index 2b987a753..21c846343 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -238,9 +238,8 @@ def get_comment(i, v=None, graceful=False) -> Optional[Comment]: return comment -def get_comments(cids, v=None, load_parent=False) -> List[Comment]: +def get_comments(cids, v=None) -> List[Comment]: if not cids: return [] - if v: votes = g.db.query(CommentVote.vote_type, CommentVote.comment_id).filter_by(user_id=v.id).subquery() @@ -280,10 +279,6 @@ def get_comments(cids, v=None, load_parent=False) -> List[Comment]: else: output = g.db.query(Comment).join(Comment.author).filter(User.shadowbanned == None, Comment.id.in_(cids)).all() - if load_parent: - parents = [x.parent_comment_id for x in output if x.parent_comment_id] - parents = get_comments(parents, v=v) - return sorted(output, key=lambda x: cids.index(x.id)) def get_sub_by_name(sub, v=None, graceful=False) -> Optional[Sub]: