allows admin to allow there users to add a question with an empty body. I would like to ask if this is necessary. couldn't an admin just set the min length of a question to 0?
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@98
0cfe37f9-358a-4d5e-be75-
b63607b5c754
self.initial = ''
def clean(self, value):
- if len(value) < settings.FORM_MIN_QUESTION_BODY:
+ if len(value) < settings.FORM_MIN_QUESTION_BODY and not settings.FORM_EMPTEY_QUESTION_BODY:
raise forms.ValidationError(_('question content must be must be at least %s characters' % settings.FORM_MIN_QUESTION_BODY))
return value
# label = _("Maximum number of characters for a question."),
# help_text = _("The maximum number of characters a user can enter into the description field to submit a question.")))
+FORM_EMPTEY_QUESTION_BODY = Setting('FORM_EMPTY_QUESTION_BODY', False, FORUM_SET, dict(
+label = _("Empty question content"),
+help_text = _("If a question's content can be empty."),
+required=False))
+
""" settings for comments """