exclude jannoids from profile views

pull/98/head
Aevann 1 week ago
parent 262b4528ae
commit 167b04543c
  1. 8
      files/routes/users.py

@ -790,7 +790,7 @@ def u_username_wall(v:Optional[User], username:str):
is_following = v and u.has_follower(v)
if v and v.id != u.id:
if v and v.id != u.id and not v.admin_level:
g.db.flush()
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
if view: view.last_view_utc = int(time.time())
@ -850,7 +850,7 @@ def u_username_wall_comment(v:User, username:str, cid):
abort(403, f"@{u.username}'s userpage is private")
return render_template("userpage/private.html", u=u, v=v, is_following=is_following), 403
if v and v.id != u.id:
if v and v.id != u.id and not v.admin_level:
g.db.flush()
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
if view: view.last_view_utc = int(time.time())
@ -904,7 +904,7 @@ def u_username(v:Optional[User], username:str):
abort(403, f"@{u.username}'s userpage is private")
return render_template("userpage/private.html", u=u, v=v, is_following=is_following), 403
if v and v.id != u.id:
if v and v.id != u.id and not v.admin_level:
g.db.flush()
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
if view: view.last_view_utc = int(time.time())
@ -981,7 +981,7 @@ def u_username_comments(username, v=None):
abort(403, f"@{u.username}'s userpage is private")
return render_template("userpage/private.html", u=u, v=v, is_following=is_following), 403
if v and v.id != u.id:
if v and v.id != u.id and not v.admin_level:
g.db.flush()
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
if view: view.last_view_utc = int(time.time())

Loading…
Cancel
Save