From a95cf32735a43459d6ba52c532fe64b01acb1b63 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 16 Mar 2023 15:38:18 +0200 Subject: [PATCH] fix badge_granting via the api --- files/routes/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 49e34891d..c3767f570 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -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')