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