This commit is contained in:
Aevann1 2022-02-04 07:30:46 +02:00
parent f6d6bbce98
commit 7f52741cac
2 changed files with 12 additions and 38 deletions

View file

@ -197,18 +197,12 @@ class Comment(Base):
@property
def replies(self):
r = self.__dict__.get("replies", None)
if r: r = [x for x in r if not x.author.shadowbanned]
if not r and r != []: r = sorted((x for x in self.child_comments if x.author and not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True)
return r
@replies.setter
def replies(self, value):
self.__dict__["replies"] = value
if self.replies2 != None: return [x for x in self.replies2 if not x.author.shadowbanned]
return sorted((x for x in self.child_comments if x.author and not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True)
@property
def replies2(self):
return self.__dict__.get("replies2", [])
return self.__dict__.get("replies2", None)
@replies2.setter
def replies2(self, value):