forked from rDrama/rDrama
master
parent
41ea61f4a1
commit
edeefc3e34
|
@ -233,9 +233,8 @@ def badge_grant_post(v):
|
||||||
user = get_user(request.form.get("username"), graceful=True)
|
user = get_user(request.form.get("username"), graceful=True)
|
||||||
if not user: return redirect("/badge_grant?error=no_user")
|
if not user: return redirect("/badge_grant?error=no_user")
|
||||||
|
|
||||||
badge_id = int(request.form.get("badge_id"))
|
try: badge_id = int(request.form.get("badge_id"))
|
||||||
|
except: abort(400)
|
||||||
badge = g.db.query(BadgeDef).filter_by(id=badge_id).first()
|
|
||||||
|
|
||||||
if user.has_badge(badge_id):
|
if user.has_badge(badge_id):
|
||||||
g.db.query(Badge).filter_by(badge_id=badge_id, user_id=user.id,).delete()
|
g.db.query(Badge).filter_by(badge_id=badge_id, user_id=user.id,).delete()
|
||||||
|
|
Loading…
Reference in New Issue