last commit backfired and made it slower, try something else

master
Aevann 2023-08-11 16:10:56 +03:00
parent 04a3e3922a
commit d886917ef0
1 changed files with 4 additions and 1 deletions

View File

@ -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)