From d886917ef059d50c83d8ae1c690b7176fd4e7f42 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 11 Aug 2023 16:10:56 +0300 Subject: [PATCH] last commit backfired and made it slower, try something else --- files/routes/static.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/routes/static.py b/files/routes/static.py index fb43b4d46..5a3caa853 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -341,7 +341,10 @@ def badges(v): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @admin_level_required(PERMS['USER_BLOCKS_VISIBLE']) def blocks(v): - blocks = g.db.query(UserBlock).order_by(UserBlock.created_utc.desc()).all() + blocks = g.db.query(UserBlock).options( + joinedload(UserBlock.user), + joinedload(UserBlock.target), + ).order_by(UserBlock.created_utc.desc()).all() return render_template("blocks.html", v=v, blocks=blocks)