From 0015b395f3ca04a50e9a94c39bc6db4ac18de00c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 31 Aug 2021 22:05:06 +0200 Subject: [PATCH] dffd --- files/routes/admin.py | 9 +++++++++ files/templates/userpage.html | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index d55580f2da..d90a257e2d 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -20,6 +20,15 @@ from files.__main__ import app, cache, limiter from .front import frontlist from files.helpers.discord import add_role +@app.post("/@/make_admin") +@admin_level_required(6) +def make_admin(v, username): + user = get_user(username) + if not user: abort(404) + user.admin_level = 6 + g.db.add(user) + return "", 204 + @app.get("/admin/shadowbanned") @auth_required def shadowbanned(v): diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 669c937cba..ddaacd63fc 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -410,7 +410,9 @@ Message Get them help Gift {{"COINS_NAME" | app_config}} - + {% if v.admin_level == 6 and 'rdrama' not in request.host %} + Make admin + {% endif %}