From 31140bdefbfc8a972a73a0d98c4202650256f43a Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 16 Aug 2023 00:09:37 +0300 Subject: [PATCH] allow ppl to see linked comments of ppl they block instead of getting a 403 https://rdrama.net/h/changelog/post/165657/changelog-megathread-marseynotes/4791944#context --- files/classes/user.py | 2 +- files/templates/comments.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 86a8894b7..6434eddac 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1137,7 +1137,7 @@ class User(Base): if SITE == 'watchpeopledie.tv' and other.id == 5: return False else: - if hasattr(other, 'is_blocking') and other.is_blocking: + if hasattr(other, 'is_blocking') and other.is_blocking and not request.path.endswith(f'/{other.id}'): return False if other.parent_post: return cls.can_see(user, other.post) diff --git a/files/templates/comments.html b/files/templates/comments.html index 6ad2a34a2..c70e1da36 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -23,7 +23,7 @@ {% set replies=c.replies(sort=sort) %} {% endif %} -{% if c.is_blocking and not c.ghost or (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id==c.author_id) %} +{% if (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id==c.author_id) %}
@@ -31,7 +31,7 @@
{% if render_replies %}