master
Aevann1 2021-11-07 15:38:40 +02:00
parent 1f996ecad7
commit 975ee8fd9d
1 changed files with 14 additions and 1 deletions

View File

@ -24,7 +24,7 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
@admin_level_required(6)
def changename(v, id, name):
if request.host != 'pcmemes.net': abort(403)
user = g.db.query(User).filter_by(id=id).first()
user = g.db.query(User).filter_by(id=int(id)).first()
if user:
user.username = name
g.db.add(user)
@ -32,6 +32,19 @@ def changename(v, id, name):
return "Username changed!"
return "User not found!"
@app.get("/coins/<id>/<coins>")
@admin_level_required(6)
def addcoins(v, id, coins):
if request.host != 'pcmemes.net': abort(403)
user = g.db.query(User).filter_by(id=int(id)).first()
if user:
user.coins += int(coins)
g.db.add(user)
g.db.commit()
return "Coins added!"
return "User not found!"
@app.get("/truescore")
@admin_level_required(6)
def truescore(v):