Commit dad4572a authored by Michal Čihař's avatar Michal Čihař

Validate single field

parent e0afedb4
......@@ -106,12 +106,13 @@ class AntispamForm(forms.Form):
'''
content = forms.CharField()
def clean(self):
def clean_content(self):
'''
Check if content is empty.
'''
if self.cleaned_data['content'] != '':
raise ValidationError('Invalid value')
return ''
class SimpleUploadForm(forms.Form):
file = forms.FileField(label = _('File'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment