forked from MarseyWorld/MarseyWorld
fix 500 error
parent
74fc191c3b
commit
85ee9cda7e
|
@ -529,7 +529,7 @@ def badge_grant_post(v):
|
||||||
g.db.add(ma)
|
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}
|
if v.client: return {"message": msg}
|
||||||
return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=True, msg=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)
|
abort(403)
|
||||||
|
|
||||||
badge = user.has_badge(badge_id)
|
badge = user.has_badge(badge_id)
|
||||||
if not badge:
|
if not badge: continue
|
||||||
continue
|
|
||||||
|
|
||||||
if v.id != user.id:
|
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}"
|
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)
|
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}
|
if v.client: return {"message": msg}
|
||||||
return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=False, msg=msg)
|
return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=False, msg=msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue