Don't show users post content from users they've blocked (#639)
This commit is contained in:
parent
4ff52b5ac0
commit
7e68277eb6
3 changed files with 10 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue