From 27a8fd46574c019236b5863d0922996b4c741d99 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 12 Nov 2022 12:11:46 +0200 Subject: [PATCH] same as last commit --- files/routes/settings.py | 4 ++-- files/routes/users.py | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index 44b059e6d..6fb831323 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -580,10 +580,10 @@ def settings_block_user(v): if user.unblockable: if not v.shadowbanned: send_notification(user.id, f"@{v.username} has tried to block you and failed because of your unblockable status!") - abort(403, "This user is unblockable.") + abort(403, f"@{user.username} is unblockable!") if user.id == v.id: abort(400, "You can't block yourself") - if user.id == AUTOJANNY_ID: abort(403, "You can't block this user") + if user.id == AUTOJANNY_ID: abort(403, f"You can't block @{user.username}") if v.has_blocked(user): abort(409, f"You have already blocked @{user.username}") new_block = UserBlock(user_id=v.id, target_id=user.id) diff --git a/files/routes/users.py b/files/routes/users.py index 0d1f890cf..abc30f5b9 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -420,10 +420,10 @@ def message2(v, username): user = get_user(username, v=v, include_blocks=True, include_shadowbanned=False) if hasattr(user, 'is_blocking') and user.is_blocking: - abort(403, "You're blocking this user.") + abort(403, f"You're blocking @{user.username}") if v.admin_level <= PERMS['MESSAGE_BLOCKED_USERS'] and hasattr(user, 'is_blocked') and user.is_blocked: - abort(403, "This user is blocking you.") + abort(403, f"@{user.username} is blocking you.") message = sanitize_raw_body(request.values.get("message"), False) if not message: abort(400, "Message is empty!") @@ -502,10 +502,10 @@ def messagereply(v): if user_id: user = get_account(user_id, v=v, include_blocks=True) if hasattr(user, 'is_blocking') and user.is_blocking: - abort(403, "You're blocking this user.") + abort(403, f"You're blocking @{user.username}") elif (v.admin_level <= PERMS['MESSAGE_BLOCKED_USERS'] and hasattr(user, 'is_blocked') and user.is_blocked): - abort(403, "You're blocked by this user.") + abort(403, f"You're blocked by @{user.username}") if parent.sentto == 2: body += process_files() @@ -686,7 +686,7 @@ def u_username(username, v=None): if not u.is_visible_to(v): if g.is_api_or_xhr or request.path.endswith(".json"): - abort(403, "This userpage is private") + abort(403, f"@{u.username}'s userpage is private") return render_template("userpage/private.html", u=u, v=v, is_following=is_following), 403 @@ -755,7 +755,7 @@ def u_username_comments(username, v=None): if not u.is_visible_to(v): if g.is_api_or_xhr or request.path.endswith(".json"): - abort(403, "This userpage is private") + abort(403, f"@{u.username}'s userpage is private") return render_template("userpage/private.html", u=u, v=v, is_following=is_following), 403 if v and hasattr(u, 'is_blocking') and u.is_blocking: @@ -811,9 +811,9 @@ def u_username_info(username, v=None): user=get_user(username, v=v, include_blocks=True, include_shadowbanned=False) if hasattr(user, 'is_blocking') and user.is_blocking: - abort(401, "You're blocking this user.") + abort(401, f"You're blocking @{user.username}") elif hasattr(user, 'is_blocked') and user.is_blocked: - abort(403, "This user is blocking you.") + abort(403, f"@{user.username} is blocking you.") return user.json @@ -824,9 +824,9 @@ def u_user_id_info(id, v=None): user=get_account(id, v=v, include_blocks=True, include_shadowbanned=False) if hasattr(user, 'is_blocking') and user.is_blocking: - abort(403, "You're blocking this user.") + abort(403, f"You're blocking @{user.username}") elif hasattr(user, 'is_blocked') and user.is_blocked: - abort(403, "This user is blocking you.") + abort(403, f"@{user.username} is blocking you.") return user.json @@ -868,7 +868,7 @@ def unfollow_user(username, v): if target.fish: if not v.shadowbanned: send_notification(target.id, f"@{v.username} has tried to unfollow you and failed because of your fish award!") - abort(400, "You can't unfollow this user!") + abort(400, f"You can't unfollow @{target.username}") follow = g.db.query(Follow).filter_by(user_id=v.id, target_id=target.id).one_or_none()