remove marsify badge when user turns it off in the settings

master
Aevann1 2022-09-19 20:54:09 +02:00
parent 45ba326222
commit a40c367e88
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ def settings_profile_post(v):
updated = True
v.marsify = int(request.values.get("marsify") == 'true')
if v.marsify: badge_grant(user=v, badge_id=170)
else:
badge = v.has_badge(170)
if badge: g.db.delete(badge)
elif request.values.get("bio") == "":
v.bio = None