From 167b04543c4b0ad8d3101e2812d4fbe19de9d4b6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 25 Jan 2023 05:45:23 +0200 Subject: [PATCH] exclude jannoids from profile views --- files/routes/users.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index d891402fc..e51b9eda6 100644 --- a/files/routes/users.py +++ b/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())