]> git.openstreetmap.org Git - osqa.git/commitdiff
Don't check minimum length of question, when body turned of, even on django 1.1.1.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 23 Aug 2010 15:04:12 +0000 (15:04 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 23 Aug 2010 15:04:12 +0000 (15:04 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@568 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/forms/qanda.py

index c3bf4c4bab5f29552db9f66237d9ef7eb762ecb6..b499cbdebdd8e4f1f80c0722134838870efa740f 100644 (file)
@@ -42,7 +42,7 @@ class QuestionEditorField(EditorField):
 
 
     def clean(self, value):
-        if self.required and (len(re.sub('[ ]{2,}', ' ', value)) < settings.FORM_MIN_QUESTION_BODY):
+        if not bool(settings.FORM_EMPTY_QUESTION_BODY) 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