From 98bae12134daf82ebaf5bd8bfa5e41e9f09b8304 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 27 Oct 2022 17:38:54 +0200 Subject: [PATCH] show the time on which ppl blocked/followed the hole --- files/routes/subs.py | 4 ++-- files/templates/sub/blockers.html | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index 41f04b29c..8a3fbfe20 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -207,7 +207,7 @@ def sub_exilees(v, sub): def sub_blockers(v, sub): sub = get_sub_by_name(sub) if sub.name == "chudrama" and not v.can_see_chudrama: abort(403) - users = g.db.query(User).join(SubBlock) \ + users = g.db.query(User, SubBlock).join(SubBlock) \ .filter_by(sub=sub.name) \ .order_by(nullslast(SubBlock.created_utc.desc()), User.username).all() @@ -220,7 +220,7 @@ def sub_blockers(v, sub): def sub_followers(v, sub): sub = get_sub_by_name(sub) if sub.name == "chudrama" and not v.can_see_chudrama: abort(403) - users = g.db.query(User).join(SubSubscription) \ + users = g.db.query(User, SubSubscription).join(SubSubscription) \ .filter_by(sub=sub.name) \ .order_by(nullslast(SubSubscription.created_utc.desc()), User.username).all() diff --git a/files/templates/sub/blockers.html b/files/templates/sub/blockers.html index ffc11b369..60ef903d4 100644 --- a/files/templates/sub/blockers.html +++ b/files/templates/sub/blockers.html @@ -11,14 +11,16 @@ # Name + {{verb.title()}} since -{% for user in users %} +{% for user, object in users %} {{loop.index}} {% include "user_in_table.html" %} + {% endfor %} -{% endblock %} \ No newline at end of file +{% endblock %}