X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c8c6b98a7b2a365878871131e0f42c40d6b499fc..49d0961a6f7f585f707cd08817f3e0a9f1a19212:/forum/forms/qanda.py diff --git a/forum/forms/qanda.py b/forum/forms/qanda.py index ade6d5d..b499cbd 100644 --- a/forum/forms/qanda.py +++ b/forum/forms/qanda.py @@ -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 @@ -168,8 +168,8 @@ class AnswerForm(forms.Form): if settings.WIKI_ON: self.fields['wiki'] = WikiField() - if question.nis.wiki: - self.fields['wiki'].initial = True + #if question.nis.wiki: + # self.fields['wiki'].initial = True class RetagQuestionForm(forms.Form): @@ -291,5 +291,8 @@ class SubscriptionSettingsForm(forms.ModelForm): class Meta: model = SubscriptionSettings +class UserPreferencesForm(forms.Form): + sticky_sorts = forms.BooleanField(required=False, initial=False) +