fix /followers and /following being empty

master
Aevann1 2022-07-04 04:59:24 +02:00
parent ed02d7572a
commit 9d0b53ad54
1 changed files with 2 additions and 2 deletions

View File

@ -843,7 +843,7 @@ def redditor_moment_redirect(username, v):
@auth_required
def followers(username, v):
u = get_user(username, v=v)
users = g.db.query(User).join(User.followers) \
users = g.db.query(User).join(User.following) \
.filter(Follow.user_id == User.id) \
.order_by(Follow.created_utc).all()
return render_template("followers.html", v=v, u=u, users=users)
@ -852,7 +852,7 @@ def followers(username, v):
@auth_required
def following(username, v):
u = get_user(username, v=v)
users = g.db.query(User).join(User.following) \
users = g.db.query(User).join(User.followers) \
.filter(Follow.target_id == User.id) \
.order_by(Follow.created_utc).all()
return render_template("following.html", v=v, u=u, users=users)