disable the slur filter in chudrama

pull/142/head
Aevann 2023-03-24 18:38:18 +02:00
parent 4ecb552169
commit 780d0eb99e
2 changed files with 18 additions and 10 deletions

View File

@ -333,7 +333,9 @@ class Comment(Base):
body = add_options(self, body, v)
if body:
body = censor_slurs(body, v)
if not (self.parent_submission and self.post.sub == 'chudrama'):
body = censor_slurs(body, v)
body = normalize_urls_runtime(body, v)
if not v or v.controversial:
captured = []
@ -365,8 +367,9 @@ class Comment(Base):
if not body: return ""
body = censor_slurs(body, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:') \
.replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseysleep:" title=":marseysleep:" src="/e/marseysleep.webp">', ':marseysleep:')
if not (self.parent_submission and self.post.sub == 'chudrama'):
body = censor_slurs(body, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:') \
.replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseysleep:" title=":marseysleep:" src="/e/marseysleep.webp">', ':marseysleep:')
return body

View File

@ -302,7 +302,9 @@ class Submission(Base):
body = add_options(self, body, v)
body = censor_slurs(body, v)
if self.sub != 'chudrama':
body = censor_slurs(body, v)
body = normalize_urls_runtime(body, v)
if not listing and not self.ghost and self.author.show_sig(v):
@ -318,8 +320,9 @@ class Submission(Base):
body = self.body
if not body: return ""
body = censor_slurs(body, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:') \
.replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseysleep:" title=":marseysleep:" src="/e/marseysleep.webp">', ':marseysleep:')
if self.sub != 'chudrama':
body = censor_slurs(body, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:') \
.replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseysleep:" title=":marseysleep:" src="/e/marseysleep.webp">', ':marseysleep:')
body = normalize_urls_runtime(body, v)
@ -328,8 +331,9 @@ class Submission(Base):
@lazy
def realtitle(self, v):
title = self.title_html
title = censor_slurs(title, v)
if self.sub != 'chudrama':
title = censor_slurs(title, v)
return title
@ -337,8 +341,9 @@ class Submission(Base):
def plaintitle(self, v):
title = self.title
title = censor_slurs(title, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:') \
.replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseysleep:" title=":marseysleep:" src="/e/marseysleep.webp">', ':marseysleep:')
if self.sub != 'chudrama':
title = censor_slurs(title, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:') \
.replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseysleep:" title=":marseysleep:" src="/e/marseysleep.webp">', ':marseysleep:')
return title