From 19ac58bce1dc3cc2da54f0ce21cfb9ba30628f4c Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 31 Aug 2023 14:04:51 +0300 Subject: [PATCH] remove redundant perm --- files/helpers/config/const.py | 1 - files/routes/users.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 6be9d5529e..6c04e43e07 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -357,7 +357,6 @@ PERMS = { # Minimum admin_level to perform action. 'BYPASS_UNDER_SIEGE_MODE': 1, 'BYPASS_CHAT_TRUESCORE_REQUIREMENT': 1, 'BYPASS_ANTISPAM_CHECKS': 1, - 'BYPASS_PROFILE_VIEWS': 1, 'WARN_ON_FAILED_LOGIN': 1, 'NOTIFICATIONS_REDDIT': 1, 'NOTIFICATIONS_SPECIFIC_WPD_COMMENTS': 1, diff --git a/files/routes/users.py b/files/routes/users.py index aed9fd852b..f4274a441b 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -950,7 +950,7 @@ def u_username_wall(v, username): is_following = v and u.has_follower(v) - if v and v.id != u.id and v.admin_level < PERMS['BYPASS_PROFILE_VIEWS'] and not session.get("GLOBAL"): + if v and v.id != u.id and v.admin_level < PERMS['USER_SHADOWBAN'] and not session.get("GLOBAL"): gevent.spawn(_add_profile_view, v.id, u.id) page = get_page() @@ -997,7 +997,7 @@ def u_username_wall_comment(v, username, cid): is_following = v and u.has_follower(v) - if v and v.id != u.id and v.admin_level < PERMS['BYPASS_PROFILE_VIEWS'] and not session.get("GLOBAL"): + if v and v.id != u.id and v.admin_level < PERMS['USER_SHADOWBAN'] and not session.get("GLOBAL"): gevent.spawn(_add_profile_view, v.id, u.id) if v and request.values.get("read"): @@ -1042,7 +1042,7 @@ def u_username(v, username): 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 v.id != u.id and v.admin_level < PERMS['BYPASS_PROFILE_VIEWS'] and not session.get("GLOBAL"): + if v and v.id != u.id and v.admin_level < PERMS['USER_SHADOWBAN'] and not session.get("GLOBAL"): gevent.spawn(_add_profile_view, v.id, u.id) sort = request.values.get("sort", "new") @@ -1109,7 +1109,7 @@ def u_username_comments(username, v): 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 v.id != u.id and v.admin_level < PERMS['BYPASS_PROFILE_VIEWS'] and not session.get("GLOBAL"): + if v and v.id != u.id and v.admin_level < PERMS['USER_SHADOWBAN'] and not session.get("GLOBAL"): gevent.spawn(_add_profile_view, v.id, u.id) page = get_page()