mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Readded spam check.
This commit is contained in:
parent
aa907a6e71
commit
0c18739d8e
1 changed files with 7 additions and 7 deletions
|
@ -47,13 +47,13 @@ class SnippetForm(forms.ModelForm):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#def clean_content(self):
|
def clean_content(self):
|
||||||
# content = self.cleaned_data.get('content')
|
content = self.cleaned_data.get('content')
|
||||||
# if content:
|
if content:
|
||||||
# regex = Spamword.objects.get_regex()
|
regex = Spamword.objects.get_regex()
|
||||||
# if regex.findall(content.lower()):
|
if regex.findall(content.lower()):
|
||||||
# raise forms.ValidationError('This snippet was identified as SPAM.')
|
raise forms.ValidationError('This snippet was identified as SPAM.')
|
||||||
# return content
|
return content
|
||||||
|
|
||||||
def save(self, parent=None, *args, **kwargs):
|
def save(self, parent=None, *args, **kwargs):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue