Adding a bunch of non-breaking spaces to the text so the minimum length of questions, answers, and comments can be bypassed is not possable anymore.
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@410
0cfe37f9-358a-4d5e-be75-
b63607b5c754
def clean(self, value):
- if self.required and (len(value) < settings.FORM_MIN_QUESTION_BODY):
+ if self.required and (len(re.sub('[ ]{2,}', ' ', value)) < settings.FORM_MIN_QUESTION_BODY):
raise forms.ValidationError(_('question content must be at least %s characters') % settings.FORM_MIN_QUESTION_BODY)
return value
self.required = True
def clean(self, value):
- if len(value) < settings.FORM_MIN_QUESTION_BODY:
+ if len(re.sub('[ ]{2,}', ' ', value)) < settings.FORM_MIN_QUESTION_BODY:
raise forms.ValidationError(_('answer content must be at least %s characters') % settings.FORM_MIN_QUESTION_BODY)
return value