Don't show users post content from users they've blocked (#639)

This commit is contained in:
justcool393 2023-07-22 17:47:44 -07:00 committed by GitHub
parent 4ff52b5ac0
commit 7e68277eb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -65,7 +65,8 @@ def api_vote_post(post_id, new, v):
new = int(new)
# get the post
post = get_post(post_id)
post = get_post(post_id, v=v)
if getattr(post, 'is_blocking', False): abort(403, "Can't vote on things from users you've blocked")
# get the old vote, if we have one
vote = g.db.query(Vote).filter_by(user_id=v.id, submission_id=post.id).one_or_none()
@ -132,7 +133,8 @@ def api_vote_comment(comment_id, new, v):
new = int(new)
# get the comment
comment = get_comment(comment_id)
comment = get_comment(comment_id, v=v)
if getattr(comment, 'is_blocking', False): abort(403, "Can't vote on things from users you've blocked")
# get the old vote, if we have one
vote = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()