forked from rDrama/rDrama
very minor dedup
parent
b5e3c5d728
commit
40b73fe048
|
@ -458,4 +458,4 @@ class Comment(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def complies_with_chud(self):
|
def complies_with_chud(self):
|
||||||
return re.search(self.author.phrase_regex_pattern, self.body_html.lower())
|
return self.author.phrase_regex.search(self.body_html.lower())
|
||||||
|
|
|
@ -363,4 +363,4 @@ class Submission(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def complies_with_chud(self):
|
def complies_with_chud(self):
|
||||||
return re.search(self.author.phrase_regex_pattern, self.body_html.lower())
|
return self.author.phrase_regex.search(self.body_html.lower())
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import random
|
import random
|
||||||
from operator import *
|
from operator import *
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
import re
|
||||||
|
|
||||||
import pyotp
|
import pyotp
|
||||||
from sqlalchemy import Column, ForeignKey
|
from sqlalchemy import Column, ForeignKey
|
||||||
|
@ -1213,5 +1214,5 @@ class User(Base):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def phrase_regex_pattern(self):
|
def phrase_regex(self):
|
||||||
return f"<p>[^<>]*{self.agendaposter_phrase}[^<>]*<\/p>"
|
return re.compile(f"<p>[^<>]*{self.agendaposter_phrase}[^<>]*<\/p>")
|
||||||
|
|
Loading…
Reference in New Issue