fix badge_granting via the api

master
Aevann 2023-03-16 15:38:18 +02:00
parent 0ef1a9c856
commit a95cf32735
1 changed files with 4 additions and 1 deletions

View File

@ -490,7 +490,10 @@ def badge_grant_post(v):
)
g.db.add(ma)
return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=True, msg=f"{new_badge.name} Badge granted to @{user.username} successfully!")
msg = f"{new_badge.name} Badge granted to @{user.username} successfully!"
if v.client: return {"message": msg}
return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=True, msg=msg)
@app.post("/admin/badge_remove")
@feature_required('BADGES')