i accidentially removed the /followers route lol

master
Aevann1 2022-09-23 20:30:17 +02:00
parent 08f9045818
commit 1af335c9b3
1 changed files with 14 additions and 0 deletions

View File

@ -899,6 +899,20 @@ def user_id(id):
def redditor_moment_redirect(username, v):
return redirect(f"/@{username}")
@app.get("/@<username>/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("/@<username>/blockers")
@auth_required
def blockers(username, v):