From dfd8ed85c996330ca1ddadb024412bafc75a5258 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 27 Oct 2023 02:21:55 +0300 Subject: [PATCH] fix %OP% snappy quote on ghost threads --- files/classes/comment.py | 2 +- files/classes/post.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 1b07a89ce..af249bacb 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -319,7 +319,7 @@ class Comment(Base): @property @lazy def author_name(self): - if self.ghost and not (g.v and self.id == g.v.id): return '👻' + if self.ghost and not (hasattr(g, 'v') and g.v and self.id == g.v.id): return '👻' return self.author.user_name @lazy diff --git a/files/classes/post.py b/files/classes/post.py index 352e3b9be..3db1b9a41 100644 --- a/files/classes/post.py +++ b/files/classes/post.py @@ -156,7 +156,7 @@ class Post(Base): @property @lazy def author_name(self): - if self.ghost and not (g.v and self.id == g.v.id): return '👻' + if self.ghost and not (hasattr(g, 'v') and g.v and self.id == g.v.id): return '👻' return self.author.user_name @property