From 290b2a9a06fcd152fd4d4bbb81621033d856a6f6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 1 Aug 2023 09:44:15 +0300 Subject: [PATCH] use smarter approach that doesnt break when going to /post/43 for example --- files/classes/comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 581a09e51..46dcdc04e 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -386,7 +386,7 @@ class Comment(Base): if path == '/admin/removed/comments': return False - if comment_link_regex.search(path): return False + if path.endswith(f'/{self.id}'): return False if self.over_18 and not (v and v.over_18) and not (path.startswith('/post/') and self.post.over_18): return True