From 9bd75a3d403251def93b0d9fe74adc66c4ca9475 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 7 Feb 2024 01:48:15 +0200 Subject: [PATCH] retro fix --- files/routes/admin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 8f289e904..a20968d55 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -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'