forked from MarseyWorld/MarseyWorld
give an actual error instead of "Forbidden"
parent
07c0fcf302
commit
d281161b68
|
@ -212,8 +212,9 @@ def upvoters_downvoters(v, username, username2, cls, vote_cls, vote_dir, templat
|
|||
u = get_user(username, v=v)
|
||||
|
||||
if username == username2:
|
||||
kind = "posts" if cls == Post else "comments"
|
||||
if not u.is_visible_to(v, 0, kind): stop(403)
|
||||
kind = "post" if cls == Post else "comment"
|
||||
if not u.is_visible_to(v, 0, f"{kind}s"):
|
||||
stop(403, f"@{u.username}'s {kind} history is private")
|
||||
|
||||
id = u.id
|
||||
|
||||
|
@ -282,8 +283,9 @@ def upvoting_downvoting(v, username, username2, cls, vote_cls, vote_dir, templat
|
|||
u = get_user(username, v=v)
|
||||
|
||||
if username == username2:
|
||||
kind = "posts" if cls == Post else "comments"
|
||||
if not u.is_visible_to(v, 0, kind): stop(403)
|
||||
kind = "post" if cls == Post else "comment"
|
||||
if not u.is_visible_to(v, 0, f"{kind}s"):
|
||||
stop(403, f"@{u.username}'s {kind} history is private")
|
||||
|
||||
id = u.id
|
||||
|
||||
|
|
Loading…
Reference in New Issue