Working on hiding filtered comments

This commit is contained in:
Julian Rota 2022-06-19 17:48:49 -04:00 committed by Ben Rog-Wilhelm
parent d1d7071304
commit ba9689f017
3 changed files with 23 additions and 6 deletions

View file

@ -231,15 +231,26 @@ class Comment(Base):
def replies(self):
if self.replies2 != None: return [x for x in self.replies2 if not x.author.shadowbanned]
if not self.parent_submission:
return sorted((x for x in self.child_comments if x.author and not x.author.shadowbanned), key=lambda x: x.created_utc)
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, AUTOCHOICE_ID)), key=lambda x: x.realupvotes, reverse=True)
return sorted((x for x in self.child_comments
if x.author
and x.filter_state not in ('filtered', 'removed')
and not x.author.shadowbanned),
key=lambda x: x.created_utc)
return sorted((x for x in self.child_comments
if x.author
and not x.author.shadowbanned
and x.filter_state not in ('filtered', 'removed')
and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)),
key=lambda x: x.realupvotes, reverse=True)
@property
def replies3(self):
def replies_ignoring_shadowbans(self):
if self.replies2 != None: return self.replies2
if not self.parent_submission:
return sorted(self.child_comments, key=lambda x: x.created_utc)
return sorted((x for x in self.child_comments if x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), key=lambda x: x.realupvotes, reverse=True)
return sorted((x for x in self.child_comments
if x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)),
key=lambda x: x.realupvotes, reverse=True)
@property
def replies2(self):