diff --git a/files/routes/users.py b/files/routes/users.py index c67a33d88..7aef0a320 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -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