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

Validate single field

parent e0afedb4
...@@ -106,12 +106,13 @@ class AntispamForm(forms.Form): ...@@ -106,12 +106,13 @@ class AntispamForm(forms.Form):
''' '''
content = forms.CharField() content = forms.CharField()
def clean(self): def clean_content(self):
''' '''
Check if content is empty. Check if content is empty.
''' '''
if self.cleaned_data['content'] != '': if self.cleaned_data['content'] != '':
raise ValidationError('Invalid value') raise ValidationError('Invalid value')
return ''
class SimpleUploadForm(forms.Form): class SimpleUploadForm(forms.Form):
file = forms.FileField(label = _('File')) 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