1
from django.conf import settings
2
from anti_spam.models import FoundSpam
6
def check_for_spam(*args, **kwargs):
8
is_spam = check_text(kwargs['text_to_check'])
11
fs = FoundSpam(content_object=kwargs['instance'],
13
spam_text=kwargs['text_to_check'][:80])
19
if any(x in text.lower() for x in settings.ANTI_SPAM_KWRDS):
21
if re.search(settings.ANTI_SPAM_PHONE_NR, text):