##// END OF EJS Templates
Disallow threads with space-only tags
neko259 -
r679:d10ed955 default
parent child Browse files
Show More
@@ -214,13 +214,12 b' class ThreadForm(PostForm):'
214
214
215 tags = forms.CharField(
215 tags = forms.CharField(
216 widget=forms.TextInput(attrs={ATTRIBUTE_PLACEHOLDER: TAGS_PLACEHOLDER}),
216 widget=forms.TextInput(attrs={ATTRIBUTE_PLACEHOLDER: TAGS_PLACEHOLDER}),
217 max_length=100, label=_('Tags'))
217 max_length=100, label=_('Tags'), required=True)
218
218
219 def clean_tags(self):
219 def clean_tags(self):
220 tags = self.cleaned_data['tags'].strip()
220 tags = self.cleaned_data['tags'].strip()
221
221
222 if tags:
222 if not tags or not self.regex_tags.match(tags):
223 if not self.regex_tags.match(tags):
224 raise forms.ValidationError(
223 raise forms.ValidationError(
225 _('Inappropriate characters in tags.'))
224 _('Inappropriate characters in tags.'))
226
225
General Comments 0
You need to be logged in to leave comments. Login now