forked from rDrama/rDrama
1
0
Fork 0

retro fix

master
Aevann 2024-02-07 01:48:15 +02:00
parent a83739f81d
commit 9bd75a3d40
1 changed files with 12 additions and 0 deletions

View File

@ -2246,3 +2246,15 @@ def unmark_effortpost(pid, v):
send_repeatable_notification(p.author_id, f":marseyitsover: @{v.username} (a site admin) has unmarked [{p.title}](/post/{p.id}) as an effortpost. {coins} coins have been deducted from you. :!marseyitsover:")
return {"message": "Post has been unmarked as an effortpost!"}
@app.post("/retrofix")
@limiter.limit('1/day')
@limiter.limit('1/day', key_func=get_ID)
@admin_level_required(5)
def retrofix(v):
posts = g.db.query(Post).filter_by(effortpost=True)
for p in posts:
print(p.title, flush=True)
coins = (p.upvotes + p.downvotes) * mul
p.author.pay_account('coins', coins)
return 'nig'