make can_see give 403 error instead of 404
parent
1496b12e8f
commit
c4d3234988
|
@ -33,7 +33,7 @@ WORDLE_COLOR_MAPPINGS = {-1: "🟥", 0: "🟨", 1: "🟩"}
|
|||
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
||||
|
||||
comment = get_comment(cid, v=v)
|
||||
if not User.can_see(v, comment): abort(404)
|
||||
if not User.can_see(v, comment): abort(403)
|
||||
|
||||
if v and request.values.get("read"):
|
||||
notif = g.db.query(Notification).filter_by(comment_id=cid, user_id=v.id, read=False).one_or_none()
|
||||
|
@ -121,7 +121,7 @@ def comment(v:User):
|
|||
parent_user = parent if isinstance(parent, User) else parent.author
|
||||
posting_to_submission = isinstance(post_target, Submission)
|
||||
|
||||
if not User.can_see(v, parent): abort(404)
|
||||
if not User.can_see(v, parent): abort(403)
|
||||
if not isinstance(parent, User) and parent.deleted_utc != 0:
|
||||
if isinstance(parent, Submission):
|
||||
abort(403, "This post has been deleted!")
|
||||
|
|
|
@ -834,7 +834,7 @@ def u_username_wall(v:Optional[User], username:str):
|
|||
def u_username_wall_comment(v:User, username:str, cid):
|
||||
comment = get_comment(cid, v=v)
|
||||
if not comment.wall_user_id: abort(400)
|
||||
if not User.can_see(v, comment): abort(404)
|
||||
if not User.can_see(v, comment): abort(403)
|
||||
|
||||
u = comment.wall_user
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
|
|||
else:
|
||||
abort(404)
|
||||
|
||||
if not User.can_see(v, target): abort(404)
|
||||
if not User.can_see(v, target): abort(403)
|
||||
|
||||
coin_delta = 1
|
||||
if v.id == target.author.id:
|
||||
|
|
Loading…
Reference in New Issue