From 747a880cdb7bad0d142a1f98f8eaf2b1f967474f Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 5 Aug 2023 17:08:14 +0300 Subject: [PATCH] fix this https://watchpeopledie.tv/h/meta/post/27855/hidden-thread-for-viewing-notifications/1385849#context --- files/classes/mod_logs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index d394b9081..d56fd8f68 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -24,6 +24,7 @@ class ModAction(Base): user = relationship("User", primaryjoin="User.id==ModAction.user_id") target_user = relationship("User", primaryjoin="User.id==ModAction.target_user_id") target_post = relationship("Post") + target_comment = relationship("Comment") def __init__(self, *args, **kwargs): if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) @@ -41,7 +42,7 @@ class ModAction(Base): def note(self): if self.kind=="ban_user": if self.target_post: return f'for post' - elif self.target_comment_id: return f'for comment' + if self.target_comment: return f'for comment' else: return self._note else: return self._note or ""