This commit is contained in:
Aevann1 2021-10-18 03:26:30 +02:00
parent 28d616b8e1
commit 80d2571dff
7 changed files with 477 additions and 505 deletions

View file

@ -1,24 +1,21 @@
from os import environ
import random
import re
import time
from urllib.parse import urlparse
from flask import render_template
from flask import render_template, g
from sqlalchemy import *
from sqlalchemy.orm import relationship, deferred
from files.__main__ import Base
from files.helpers.const import SLURS, AUTOPOLLER_ACCOUNT
import re, random
from urllib.parse import urlparse
from files.helpers.lazy import lazy
from files.helpers.const import SLURS, AUTOPOLLER_ACCOUNT
from files.__main__ import Base
from .flags import Flag
from ..helpers.word_censor import censor_slurs
from os import environ
import time
site = environ.get("DOMAIN").strip()
site_name = environ.get("SITE_NAME").strip()
class Submission(Base):
__tablename__ = "submissions"
id = Column(BigInteger, primary_key=True)
@ -343,7 +340,9 @@ class Submission(Base):
if self.club and not (v and v.paid_dues): return "COUNTRY CLUB ONLY"
body = self.body_html
body = censor_slurs(body, v)
if not v or v.slurreplacer:
for s,r in SLURS.items():
body = body.replace(s, r)
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
@ -353,7 +352,9 @@ class Submission(Base):
if self.club and not (v and v.paid_dues): return "COUNTRY CLUB ONLY"
body = self.body
body = censor_slurs(body, v)
if not v or v.slurreplacer:
for s,r in SLURS.items():
body = body.replace(s, r)
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")