From 1e2ef23344d6c4dbc011dd80fc2d5c0b64aa5c09 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 8 Sep 2023 21:16:12 +0300 Subject: [PATCH] fix accidentially deleted endpoint :derp: --- files/routes/static.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/files/routes/static.py b/files/routes/static.py index 83848e5d3..317521d70 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -338,6 +338,18 @@ def badges(v): badges, counts = badge_list(SITE, v.admin_level >= PERMS['VIEW_PATRONS']) return render_template("badges.html", v=v, badges=badges, counts=counts) +@app.get("/blocks") +@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) +@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) +@auth_required +def blocks(v): + blocks = g.db.query(UserBlock).options( + joinedload(UserBlock.user), + joinedload(UserBlock.target), + ).order_by(UserBlock.created_utc.desc()) + + return render_template("blocks.html", v=v, blocks=blocks) + @app.get("/notification_mutes") @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)