From 8dcfaf21f9367ef6521080072a6722cb2002a9a6 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 4 Feb 2022 04:22:58 +0200 Subject: [PATCH] sfd --- files/classes/comment.py | 2 +- files/helpers/sanitize.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 1b471674a..f79c090b0 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -199,7 +199,7 @@ class Comment(Base): 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 not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True) + 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 diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index f0d2a33b7..43d0d48b2 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -151,7 +151,6 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): soup = BeautifulSoup(sanitized, features="html.parser") for tag in soup.find_all("img"): - if tag.get("src") and tag.get("class") != ['pp20']: tag["class"] = "in-comment-image" tag["loading"] = "lazy"