From 667b5c038832efc27afe8d861aae0f0c476e1929 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 7 Feb 2024 06:09:10 +0200 Subject: [PATCH] order holes by time created cuz it makes the most sense --- files/routes/holes.py | 4 ++-- files/templates/hole/holes.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/holes.py b/files/routes/holes.py index abc42235d..043f07962 100644 --- a/files/routes/holes.py +++ b/files/routes/holes.py @@ -736,9 +736,9 @@ def hole_marsey(v, hole): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required def subs(v): - subs = g.db.query(Hole, func.count(Post.hole)).outerjoin(Post, Hole.name == Post.hole).group_by(Hole.name).order_by(func.count(Post.hole).desc()).all() + holes = g.db.query(Hole, func.count(Post.hole)).outerjoin(Post, Hole.name == Post.hole).group_by(Hole.name).order_by(hole.created_utc).all() total_users = g.db.query(User).count() - return render_template('hole/holes.html', v=v, subs=subs, total_users=total_users) + return render_template('hole/holes.html', v=v, holes=holes, total_users=total_users) @app.post("/hole_pin/") @limiter.limit('1/second', scope=rpath) diff --git a/files/templates/hole/holes.html b/files/templates/hole/holes.html index 4c1cfacb7..95de6e885 100644 --- a/files/templates/hole/holes.html +++ b/files/templates/hole/holes.html @@ -15,7 +15,7 @@ - {% for hole, count in subs %} + {% for hole, count in holes %} {{loop.index}} {{hole}} {% if hole.name in v.hole_blocks %}[blocked, visit it to unblock it]{% endif %}