master
Aevann1 2021-09-17 19:01:47 +02:00
parent 33962c24b9
commit d9709a9c48
1 changed files with 6 additions and 5 deletions

View File

@ -312,6 +312,7 @@ def gumroad(v):
return {"error": f"{patron} rewards already claimed"}, 400
v.patron = tier
g.db.add(v)
grant_awards = {}
if tier == 1:
@ -355,12 +356,12 @@ def gumroad(v):
g.db.bulk_save_objects(_awards)
new_badge = Badge(badge_id=20+tier,
user_id=v.id,
)
g.db.add(new_badge)
if not v.has_badge(20+tier):
new_badge = Badge(badge_id=20+tier,
user_id=v.id,
)
g.db.add(new_badge)
g.db.add(v)
g.db.commit()
return {"message": f"{patron} rewards claimed!"}