From 0c18739d8e97da07e9ffc56d305bd9ab7e0db433 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Wed, 8 Jun 2011 12:17:23 +0200 Subject: [PATCH] Readded spam check. --- pastebin/apps/dpaste/forms.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pastebin/apps/dpaste/forms.py b/pastebin/apps/dpaste/forms.py index 213c6c2..b115a41 100644 --- a/pastebin/apps/dpaste/forms.py +++ b/pastebin/apps/dpaste/forms.py @@ -47,13 +47,13 @@ class SnippetForm(forms.ModelForm): except KeyError: pass - #def clean_content(self): - # content = self.cleaned_data.get('content') - # if content: - # regex = Spamword.objects.get_regex() - # if regex.findall(content.lower()): - # raise forms.ValidationError('This snippet was identified as SPAM.') - # return content + def clean_content(self): + content = self.cleaned_data.get('content') + if content: + regex = Spamword.objects.get_regex() + if regex.findall(content.lower()): + raise forms.ValidationError('This snippet was identified as SPAM.') + return content def save(self, parent=None, *args, **kwargs):