diff --git a/files/helpers/const.py b/files/helpers/const.py index b08529e42..a7d2d8f00 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -185,7 +185,7 @@ PERMS = { # Minimum admin_level to perform action. 'NOTIFICATIONS_MODMAIL': 3, 'NOTIFICATIONS_SPECIFIC_WPD_COMMENTS': 1, 'MESSAGE_BLOCKED_USERS': 1, - 'APPS_MODERATE': 3, + 'APPS_MODERATION': 3, 'STREAMERS_MODERATION': 2, 'UNKNOWN_ADMIN_LEVEL2_PERM1': 2, 'UNKNOWN_ADMIN_LEVEL2_PERM2': 2, diff --git a/files/routes/oauth.py b/files/routes/oauth.py index 35f46d118..ea736d6cf 100644 --- a/files/routes/oauth.py +++ b/files/routes/oauth.py @@ -83,7 +83,7 @@ def request_api_keys(v): new_comment.top_comment_id = new_comment.id - for admin in g.db.query(User).filter(User.admin_level >= PERMS['APPS_MODERATE']).all(): + for admin in g.db.query(User).filter(User.admin_level >= PERMS['APPS_MODERATION']).all(): notif = Notification(comment_id=new_comment.id, user_id=admin.id) g.db.add(notif) @@ -137,7 +137,7 @@ def edit_oauth_app(v, aid): @app.post("/admin/app/approve/") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(PERMS['APPS_MODERATE']) +@admin_level_required(PERMS['APPS_MODERATION']) def admin_app_approve(v, aid): app = g.db.get(OauthApp, aid) @@ -173,7 +173,7 @@ def admin_app_approve(v, aid): @app.post("/admin/app/revoke/") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(PERMS['APPS_MODERATE']) +@admin_level_required(PERMS['APPS_MODERATION']) def admin_app_revoke(v, aid): app = g.db.get(OauthApp, aid) @@ -198,7 +198,7 @@ def admin_app_revoke(v, aid): @app.post("/admin/app/reject/") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(PERMS['APPS_MODERATE']) +@admin_level_required(PERMS['APPS_MODERATION']) def admin_app_reject(v, aid): app = g.db.get(OauthApp, aid) @@ -223,7 +223,7 @@ def admin_app_reject(v, aid): @app.get("/admin/app/") -@admin_level_required(PERMS['APPS_MODERATE']) +@admin_level_required(PERMS['APPS_MODERATION']) def admin_app_id(v, aid): aid=aid oauth = g.db.get(OauthApp, aid) @@ -244,7 +244,7 @@ def admin_app_id(v, aid): ) @app.get("/admin/app//comments") -@admin_level_required(PERMS['APPS_MODERATE']) +@admin_level_required(PERMS['APPS_MODERATION']) def admin_app_id_comments(v, aid): aid=aid @@ -271,7 +271,7 @@ def admin_app_id_comments(v, aid): @app.get("/admin/apps") -@admin_level_required(PERMS['APPS_MODERATE']) +@admin_level_required(PERMS['APPS_MODERATION']) def admin_apps_list(v): apps = g.db.query(OauthApp).order_by(OauthApp.id.desc()).all() diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index ed324624f..2bc0050e3 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -102,7 +102,7 @@ {% if v.admin_level >= PERMS['HOLE_CREATE'] %}
  • Create {{ HOLE_NAME | capitalize }}
  • {% endif %} - {% if v.admin_level >= PERMS['APPS_MODERATE'] %} + {% if v.admin_level >= PERMS['APPS_MODERATION'] %}
  • Apps
  • {% endif %} diff --git a/files/templates/comments.html b/files/templates/comments.html index bcd30e88e..b03bcaa13 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -490,7 +490,7 @@ {% endif %} -{% if v.admin_level >= PERMS['APPS_MODERATE'] and c.oauth_app %} +{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %} API App {% endif %} @@ -721,7 +721,7 @@ {% endif %} {% endif %} - {% if c.oauth_app and v.admin_level >= PERMS['APPS_MODERATE'] %} + {% if c.oauth_app and v.admin_level >= PERMS['APPS_MODERATION'] %} API App {% endif %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index 34131ba28..bc937b17a 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -34,7 +34,7 @@ {% endif %} - {% if p.oauth_app and v.admin_level >= PERMS['APPS_MODERATE'] %} + {% if p.oauth_app and v.admin_level >= PERMS['APPS_MODERATION'] %} {% endif %}