fix bug where including the agendaposter phrase in the title exempted u from torture_ap

master
Aevann 2023-03-23 21:03:02 +02:00
parent ca4f6c5102
commit 7eee498070
1 changed files with 6 additions and 4 deletions

View File

@ -618,19 +618,21 @@ def complies_with_chud(obj):
if not obj.author.agendaposter: return True if not obj.author.agendaposter: return True
if obj.author.marseyawarded: return True if obj.author.marseyawarded: return True
old_body_html = obj.body_html.lower()
if isinstance(obj, Submission): if isinstance(obj, Submission):
if obj.id in ADMIGGER_THREADS: return True if obj.id in ADMIGGER_THREADS: return True
if obj.sub == "chudrama": return True if obj.sub == "chudrama": return True
if obj.author.agendaposter_phrase in obj.title: return True
elif obj.parent_submission: elif obj.parent_submission:
if obj.parent_submission in ADMIGGER_THREADS: return True if obj.parent_submission in ADMIGGER_THREADS: return True
if obj.post.sub == "chudrama": return True if obj.post.sub == "chudrama": return True
soup=BeautifulSoup(obj.body_html.lower(), 'lxml') obj.body_html = torture_ap(obj.body_html, obj.author.username)
if isinstance(obj, Submission): if isinstance(obj, Submission):
obj.title_html = torture_ap(obj.title_html, obj.author.username) obj.title_html = torture_ap(obj.title_html, obj.author.username)
obj.body_html = torture_ap(obj.body_html, obj.author.username) if obj.author.agendaposter_phrase in obj.title: return True
soup=BeautifulSoup(old_body_html, 'lxml')
tags = soup.html.body.find_all(lambda tag: tag.name == 'p' and not tag.attrs, recursive=False) tags = soup.html.body.find_all(lambda tag: tag.name == 'p' and not tag.attrs, recursive=False)