get: remove weird vestigal load_parent part of get_comment

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-27 19:37:54 -05:00
parent 5d9ddcc0f4
commit 308e9cbbd6
1 changed files with 1 additions and 6 deletions

View File

@ -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]: