clicking twice shouldn't generate a mod log

master
Aevann1 2022-12-16 22:17:03 +02:00
parent 78b7652689
commit b6c01fb275
1 changed files with 9 additions and 10 deletions

View File

@ -212,9 +212,8 @@ def make_admin(v:User, username):
@admin_level_required(PERMS['ADMIN_REMOVE'])
def remove_admin(v:User, username):
user = get_user(username)
if user.id == v.id:
abort(403, "You can't remove yourself JC")
if user.admin_level:
user.admin_level = 0
g.db.add(user)