From 1af335c9b35192fdc8e50fc3eef12d386def664e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Sep 2022 20:30:17 +0200 Subject: [PATCH] i accidentially removed the /followers route lol --- files/routes/users.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/files/routes/users.py b/files/routes/users.py index 7d90385da..aade935c8 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -899,6 +899,20 @@ def user_id(id): def redditor_moment_redirect(username, v): return redirect(f"/@{username}") +@app.get("/@/followers") +@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(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) + @app.get("/@/blockers") @auth_required def blockers(username, v):