示例#1
0
    def auto_detect_spam(self, user):
        if user.url:
            m = re.search(SPAM_TLDS_PATTERN, user.url)
            if m:
                return (True, 'url contains "%s"' % m.string[m.start():m.end()])

        if user.bio:
            m = re.search(SPAM_TERMS_PATTERN, user.bio)
            if m:
                return (True, 'bio contains "%s"' % m.string[m.start():m.end()])

        if user.url:
            m = re.search(SPAM_TERMS_PATTERN, user.url)
            if m:
                return (True, 'url contains "%s"' % m.string[m.start():m.end()])

        # doing this last to avoid unnecessary wait
        if user.bio: 
            if check_post_for_spam_via_defensio(user.bio):
                return (True, '')
        return (False, '')
示例#2
0
文件: models.py 项目: hgw/rhizome.org
    def auto_detect_spam(self, user):
        if user.url:
            m = re.search(SPAM_TLDS_PATTERN, user.url)
            if m:
                return (True,
                        'url contains "%s"' % m.string[m.start():m.end()])

        if user.bio:
            m = re.search(SPAM_TERMS_PATTERN, user.bio)
            if m:
                return (True,
                        'bio contains "%s"' % m.string[m.start():m.end()])

        if user.url:
            m = re.search(SPAM_TERMS_PATTERN, user.url)
            if m:
                return (True,
                        'url contains "%s"' % m.string[m.start():m.end()])

        # doing this last to avoid unnecessary wait
        if user.bio:
            if check_post_for_spam_via_defensio(user.bio):
                return (True, '')
        return (False, '')
示例#3
0
 def auto_detect_spam(self, post):
     if check_post_for_spam_via_defensio(post.description):
         return (True, "")
     return (False, "")
示例#4
0
文件: models.py 项目: hgw/rhizome.org
 def auto_detect_spam(self, post):
     if check_post_for_spam_via_defensio(post.description):
         return (True, '')
     return (False, '')
示例#5
0
 def auto_detect_spam(self, comment):
     if check_post_for_spam_via_defensio(comment.comment):
         return (True, '')
     return (False, '')
示例#6
0
 def auto_detect_spam(self, thread):
     if check_post_for_spam_via_defensio(thread.content_object.comment):
         return (True, '')
     return (False, '')
示例#7
0
文件: models.py 项目: hgw/rhizome.org
 def auto_detect_spam(self, comment):
     if check_post_for_spam_via_defensio(comment.comment):
         return (True, '')
     return (False, '')
示例#8
0
文件: models.py 项目: hgw/rhizome.org
 def auto_detect_spam(self, thread):
     if check_post_for_spam_via_defensio(thread.content_object.comment):
         return (True, '')
     return (False, '')