From 5574b1fb742c243bb3fd4c5ba631c444a1b292e2 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 1 Aug 2023 01:25:01 +0300 Subject: [PATCH] fix this https://rdrama.net/h/meta/post/192280/why-is-every-comment-on-18 --- files/classes/comment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index bfca580b83..581a09e515 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -381,14 +381,14 @@ class Comment(Base): return body @lazy - def collapse_for_user(self, v, path): + def collapse_for_user(self, v, path=''): if v and self.author_id == v.id: return False if path == '/admin/removed/comments': return False if comment_link_regex.search(path): return False - if self.over_18 and not (v and v.over_18): return True + if self.over_18 and not (v and v.over_18) and not (path.startswith('/post/') and self.post.over_18): return True if self.is_banned: return True