From c15e0f6fadeb67c178b7ad8d37aece72df0d7040 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 23:52:56 +0200 Subject: [PATCH] show follow time --- files/routes/users.py | 4 +++- files/templates/followers.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index 95ef62a78..dd52cb4b9 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -879,10 +879,12 @@ def redditor_moment_redirect(username, v): @auth_required def followers(username, v): u = get_user(username, v=v) + if u.id == CARP_ID: abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']): abort(403) - users = g.db.query(User).join(Follow, Follow.target_id == u.id) \ + users = g.db.query(Follow, User).join(Follow, Follow.target_id == u.id) \ .filter(Follow.user_id == User.id) \ .order_by(Follow.created_utc).all() return render_template("followers.html", v=v, u=u, users=users) diff --git a/files/templates/followers.html b/files/templates/followers.html index e3858afe7..5dc710ab3 100644 --- a/files/templates/followers.html +++ b/files/templates/followers.html @@ -11,16 +11,18 @@ # Name + Following Since {% if v.id == u.id %} {% endif %} -{% for user in users %} +{% for follow, user in users %} {{loop.index}} {% include "user_in_table.html" %} + {% if v.id == u.id %}
Remove follow
{% endif %}