diff --git a/files/helpers/get.py b/files/helpers/get.py index 57be15b59d..2dc3210fab 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -291,7 +291,7 @@ def add_vote_and_block_props(target:Union[Submission, Comment], v:Optional[User] def get_comments(cids:Iterable[int], v:Optional[User]=None, extra:Optional[Callable[[Query], Query]]=None) -> List[Comment]: if not cids: return [] if v: - output = get_comments_v_properties(v, True, None, Comment.id.in_(cids))[1] # TODO: support 'extra' for get_comments_v_properties + output = get_comments_v_properties(v, None, Comment.id.in_(cids))[1] else: output = g.db.query(Comment).join(Comment.author) if extra: output = extra(output) diff --git a/files/routes/comments.py b/files/routes/comments.py index 4cabfe90ce..cdb8eb1af5 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -70,7 +70,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): if v: # this is required because otherwise the vote and block # props won't save properly unless you put them in a list - output = get_comments_v_properties(v, False, None, Comment.top_comment_id == c.top_comment_id)[1] + output = get_comments_v_properties(v, None, Comment.top_comment_id == c.top_comment_id)[1] post.replies=[top_comment] execute_shadowban_viewers_and_voters(v, post) diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 701e2797c0..650c6f1518 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -369,7 +369,7 @@ def notifications(v:User): total_cids = [x.id for x in total] total_cids.extend(cids) total_cids = set(total_cids) - output = get_comments_v_properties(v, True, None, Comment.id.in_(total_cids))[1] + output = get_comments_v_properties(v, None, Comment.id.in_(total_cids))[1] g.db.commit() diff --git a/files/routes/posts.py b/files/routes/posts.py index fed62e4f67..1cc5ca426c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -101,7 +101,7 @@ def post_id(pid, anything=None, v=None, sub=None): execute_shadowban_viewers_and_voters(v, post) # shadowban check is done in sort_objects # output is needed: see comments.py - comments, output = get_comments_v_properties(v, True, None, Comment.parent_submission == post.id, Comment.level < 10) + comments, output = get_comments_v_properties(v, None, Comment.parent_submission == post.id, Comment.level < 10) pinned = [c[0] for c in comments.filter(Comment.stickied != None).order_by(Comment.created_utc.desc()).all()] comments = comments.filter(Comment.level == 1, Comment.stickied == None) comments = sort_objects(sort, comments, Comment) @@ -188,7 +188,7 @@ def view_more(v, pid, sort, offset): if v: # shadowban check is done in sort_objects # output is needed: see comments.py - comments, output = get_comments_v_properties(v, True, None, Comment.parent_submission == pid, Comment.stickied == None, Comment.id.notin_(ids), Comment.level < 10) + comments, output = get_comments_v_properties(v, None, Comment.parent_submission == pid, Comment.stickied == None, Comment.id.notin_(ids), Comment.level < 10) comments = comments.filter(Comment.level == 1) comments = sort_objects(sort, comments, Comment) @@ -239,7 +239,7 @@ def more_comments(v, cid): if v: # shadowban check is done in sort_objects i think # output is needed: see comments.py - comments, output = get_comments_v_properties(v, True, None, Comment.top_comment_id == tcid, Comment.level > 9) + comments, output = get_comments_v_properties(v, None, Comment.top_comment_id == tcid, Comment.level > 9) comments = comments.filter(Comment.parent_comment_id == cid) comments = [c[0] for c in comments.all()] else: diff --git a/files/routes/users.py b/files/routes/users.py index 7da9c486cb..79ec93e004 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -820,7 +820,7 @@ def u_username_wall(v:Optional[User], username:str): except: page = 1 if v: - comments, output = get_comments_v_properties(v, True, None, Comment.wall_user_id == u.id) + comments, output = get_comments_v_properties(v, None, Comment.wall_user_id == u.id) else: comments = g.db.query(Comment).filter(Comment.wall_user_id == u.id) comments = comments.filter(Comment.level == 1) @@ -891,7 +891,7 @@ def u_username_wall_comment(v:User, username:str, cid): if v: # this is required because otherwise the vote and block # props won't save properly unless you put them in a list - output = get_comments_v_properties(v, False, None, Comment.top_comment_id == c.top_comment_id)[1] + output = get_comments_v_properties(v, None, Comment.top_comment_id == c.top_comment_id)[1] if v and v.client: return top_comment.json(db=g.db)