~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to pybb/forms.py

  • Committer: franku
  • Date: 2016-12-12 18:22:47 UTC
  • mfrom: (442 trunk)
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: somal@arcor.de-20161212182247-gyy7vv0byc366pgc
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from django.core.mail import send_mail
15
15
from django.contrib.sites.models import Site
16
16
 
17
 
INTERN_PHONE_NR = re.compile('([0]{2}|[\+\@\ ]{1})\d{2}[\ \-\=]{,1}\d{8,11}')
18
 
 
19
17
class AddPostForm(forms.ModelForm):
20
18
    name = forms.CharField(label=_('Subject'))
21
19
    attachment = forms.FileField(label=_('Attachment'), required=False)
77
75
        if any(x in text.lower() for x in settings.ANTI_SPAM_BODY):
78
76
            hidden = True
79
77
 
80
 
        if re.search(INTERN_PHONE_NR, text):
 
78
        if re.search(settings.ANTI_SPAM_PHONE_NR, text):
81
79
            hidden = True
82
80
        
83
81
        if topic_is_new:
84
82
            text = self.cleaned_data['name']
85
83
            if any(x in text.lower() for x in settings.ANTI_SPAM_TOPIC):
86
84
                hidden = True
87
 
            if re.search(INTERN_PHONE_NR, text):
 
85
            if re.search(settings.ANTI_SPAM_PHONE_NR, text):
88
86
                hidden = True
89
87
 
90
88
        post = Post(topic=topic, user=self.user, user_ip=self.ip,