##// END OF EJS Templates
Strip text and tags before saving
neko259 -
r678:fba82bb1 default
parent child Browse files
Show More
@@ -126,7 +126,7 b' class PostForm(NeboardForm):'
126 return title
126 return title
127
127
128 def clean_text(self):
128 def clean_text(self):
129 text = self.cleaned_data['text']
129 text = self.cleaned_data['text'].strip()
130 if text:
130 if text:
131 if len(text) > board_settings.MAX_TEXT_LENGTH:
131 if len(text) > board_settings.MAX_TEXT_LENGTH:
132 raise forms.ValidationError(_('Text must have less than %s '
132 raise forms.ValidationError(_('Text must have less than %s '
@@ -217,7 +217,7 b' class ThreadForm(PostForm):'
217 max_length=100, label=_('Tags'))
217 max_length=100, label=_('Tags'))
218
218
219 def clean_tags(self):
219 def clean_tags(self):
220 tags = self.cleaned_data['tags']
220 tags = self.cleaned_data['tags'].strip()
221
221
222 if tags:
222 if tags:
223 if not self.regex_tags.match(tags):
223 if not self.regex_tags.match(tags):
General Comments 0
You need to be logged in to leave comments. Login now