From 85ee9cda7e9d5a6c72c16e586c95df91fc5e25c7 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 4 Aug 2023 19:15:51 +0300 Subject: [PATCH] fix 500 error --- files/routes/admin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index f23f418dd..d26fcd308 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -529,7 +529,7 @@ def badge_grant_post(v): g.db.add(ma) - msg = f"{new_badge.name} Badge granted to users successfully!" + msg = "Badge granted to users successfully!" if v.client: return {"message": msg} return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=True, msg=msg) @@ -561,8 +561,7 @@ def badge_remove_post(v): abort(403) badge = user.has_badge(badge_id) - if not badge: - continue + if not badge: continue if v.id != user.id: text = f"@{v.username} (a site admin) has removed the following profile badge from you:\n\n{badge.path}\n\n**{badge.name}**\n\n{badge.badge.description}" @@ -578,7 +577,7 @@ def badge_remove_post(v): g.db.delete(badge) - msg = f"{badge.name} Badge removed from users successfully!" + msg = "Badge removed from users successfully!" if v.client: return {"message": msg} return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=False, msg=msg)