summaryrefslogtreecommitdiffstats
path: root/askbot/forms.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-09 22:34:05 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-09 22:34:05 -0400
commit5a4d662c61b0f5e35a3d1c060d143a1d1716a9d3 (patch)
treeac389f7d35eb4f26a28e548662ac9c6851d0080f /askbot/forms.py
parentd5ad209ce833a7c863d6d29eded6a8ca5cb476b7 (diff)
parent38f7631b55da2401de73ccec8b3e2425e4b21377 (diff)
downloadaskbot-5a4d662c61b0f5e35a3d1c060d143a1d1716a9d3.tar.gz
askbot-5a4d662c61b0f5e35a3d1c060d143a1d1716a9d3.tar.bz2
askbot-5a4d662c61b0f5e35a3d1c060d143a1d1716a9d3.zip
merged Adolfo's branch
Diffstat (limited to 'askbot/forms.py')
-rw-r--r--askbot/forms.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index 43993cad..eb791595 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -928,12 +928,12 @@ class AskWidgetForm(forms.Form, FormWithHideableFields):
#hide ask_anonymously field
if not askbot_settings.ALLOW_ASK_ANONYMOUSLY:
self.hide_field('ask_anonymously')
- self.fields['text'] = EditorField()
+ self.fields['text'] = QuestionEditorField()
if not include_text:
self.hide_field('text')
- self.fields['text'].required=False
- else:
- self.fields['text'].min_length = askbot_settings.MIN_QUESTION_BODY_LENGTH
+ #hack to make it validate
+ self.fields['text'].required = False
+ self.fields['text'].min_length = 0
class CreateAskWidgetForm(forms.Form, FormWithHideableFields):
title = forms.CharField(max_length=100)
@@ -951,14 +951,14 @@ class CreateAskWidgetForm(forms.Form, FormWithHideableFields):
def __init__(self, *args, **kwargs):
from askbot.models import Tag
super(CreateAskWidgetForm, self).__init__(*args, **kwargs)
- #self.fields['group'] = forms.ModelChoiceField(
- # queryset=get_groups().exclude(name__startswith='_internal_'),
- # required=False
- #)
+ self.fields['group'] = forms.ModelChoiceField(
+ queryset=get_groups().exclude(name__startswith='_internal_'),
+ required=False
+ )
self.fields['tag'] = forms.ModelChoiceField(queryset=Tag.objects.get_content_tags(),
required=False)
- #if not askbot_settings.GROUPS_ENABLED:
- # self.hide_field('group')
+ if not askbot_settings.GROUPS_ENABLED:
+ self.hide_field('group')
class CreateQuestionWidgetForm(forms.Form, FormWithHideableFields):
title = forms.CharField(max_length=100)
@@ -978,10 +978,10 @@ class CreateQuestionWidgetForm(forms.Form, FormWithHideableFields):
def __init__(self, *args, **kwargs):
super(CreateQuestionWidgetForm, self).__init__(*args, **kwargs)
self.fields['tagnames'] = TagNamesField()
- #self.fields['group'] = forms.ModelChoiceField(
- # queryset=get_groups().exclude(name__startswith='_internal'),
- # required=False
- #)
+ self.fields['group'] = forms.ModelChoiceField(
+ queryset=get_groups().exclude(name__startswith='_internal'),
+ required=False
+ )
class AskByEmailForm(forms.Form):
""":class:`~askbot.forms.AskByEmailForm`