fix benefactor exploit (thx sneks my beloved)

master
Aevann1 2022-06-10 22:40:04 +02:00
parent 79bc71f132
commit 87ba1ba50e
1 changed files with 1 additions and 0 deletions

View File

@ -337,6 +337,7 @@ def award_thing(v, thing_type, id):
g.db.flush()
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
elif kind == "benefactor":
if author.patron: return {"error": "This user is already a paypig!"}, 400
author.patron = 1
if author.patron_utc: author.patron_utc += 2629746
else: author.patron_utc = int(time.time()) + 2629746