From 2805fd2d142a0ad957251c7d8c3bf3c300446909 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 23 Mar 2023 22:19:29 +0200 Subject: [PATCH] print-debug weird 500 error --- files/helpers/sanitize.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index e897361cb..62623741b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -634,6 +634,10 @@ def complies_with_chud(obj): soup=BeautifulSoup(old_body_html, 'lxml') + if not soup.html: + print(f'{STARS}{old_body_html}{STARS}', flush=True) + return False + tags = soup.html.body.find_all(lambda tag: tag.name == 'p' and not tag.attrs, recursive=False) for tag in tags: