diff options
author | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-09-06 16:02:42 -0600 |
---|---|---|
committer | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-09-06 21:32:03 -0600 |
commit | 7a529933b5dc593261c458b9761c183fe3b39de6 (patch) | |
tree | 980c1922fcf63b3b65441125f34404ee3f0c0954 /askbot/forms.py | |
parent | d8a91b709150faf16f354515e6a62770ec975135 (diff) | |
download | askbot-7a529933b5dc593261c458b9761c183fe3b39de6.tar.gz askbot-7a529933b5dc593261c458b9761c183fe3b39de6.tar.bz2 askbot-7a529933b5dc593261c458b9761c183fe3b39de6.zip |
fixed css for error display, fixed upload from widgets, added groups support again for widgets
Diffstat (limited to 'askbot/forms.py')
-rw-r--r-- | askbot/forms.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/askbot/forms.py b/askbot/forms.py index 0ed888a5..38ba73fa 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -916,12 +916,10 @@ 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 class CreateAskWidgetForm(forms.Form, FormWithHideableFields): title = forms.CharField(max_length=100) @@ -939,14 +937,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) @@ -966,10 +964,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` |