From ec6d59b5a44d7bec3fcfbddeb37e25d45b360c60 Mon Sep 17 00:00:00 2001 From: hernani Date: Fri, 7 Jan 2011 15:52:59 +0000 Subject: [PATCH 1/1] Disables the recaptcha feature for a while. It was causing some nasty bugs. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@671 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/forms/qanda.py | 16 ++++++++-------- forum/settings/minrep.py | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/forum/forms/qanda.py b/forum/forms/qanda.py index 9370550..94285c7 100644 --- a/forum/forms/qanda.py +++ b/forum/forms/qanda.py @@ -158,8 +158,8 @@ class AskForm(forms.Form): self.fields['tags'] = TagNamesField(user) - if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): - self.fields['captcha'] = ReCaptchaField() + #if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): + # self.fields['captcha'] = ReCaptchaField() if settings.WIKI_ON: self.fields['wiki'] = WikiField() @@ -171,8 +171,8 @@ class AnswerForm(forms.Form): def __init__(self, data=None, user=None, *args, **kwargs): super(AnswerForm, self).__init__(data, *args, **kwargs) - if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): - self.fields['captcha'] = ReCaptchaField() + #if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): + # self.fields['captcha'] = ReCaptchaField() if settings.WIKI_ON: self.fields['wiki'] = WikiField() @@ -219,8 +219,8 @@ class EditQuestionForm(forms.Form): self.fields['tags'] = TagNamesField(user) self.fields['tags'].initial = revision.tagnames - if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): - self.fields['captcha'] = ReCaptchaField() + #if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): + # self.fields['captcha'] = ReCaptchaField() if settings.WIKI_ON: self.fields['wiki'] = WikiField(disabled=(question.nis.wiki and not user.can_cancel_wiki(question)), initial=question.nis.wiki) @@ -237,8 +237,8 @@ class EditAnswerForm(forms.Form): self.fields['text'].initial = revision.body - if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): - self.fields['captcha'] = ReCaptchaField() + #if int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff): + # self.fields['captcha'] = ReCaptchaField() if settings.WIKI_ON: self.fields['wiki'] = WikiField(disabled=(answer.nis.wiki and not user.can_cancel_wiki(answer)), initial=answer.nis.wiki) diff --git a/forum/settings/minrep.py b/forum/settings/minrep.py index 8206823..f00053e 100644 --- a/forum/settings/minrep.py +++ b/forum/settings/minrep.py @@ -3,9 +3,9 @@ from django.utils.translation import ugettext_lazy as _ MIN_REP_SET = SettingSet('minrep', _('Minimum reputation config'), _("Configure the minimum reputation required to perform certain actions on your site."), 300) -CAPTCHA_IF_REP_LESS_THAN = Setting('CAPTCHA_IF_REP_LESS_THAN', 0, MIN_REP_SET, dict( -label = _("Show captcha if user with less reputation than"), -help_text = _("If the user has less reputation, captcha is used to when adding new content."))) +#CAPTCHA_IF_REP_LESS_THAN = Setting('CAPTCHA_IF_REP_LESS_THAN', 0, MIN_REP_SET, dict( +#label = _("Show captcha if user with less reputation than"), +#help_text = _("If the user has less reputation, captcha is used to when adding new content."))) REP_TO_VOTE_UP = Setting('REP_TO_VOTE_UP', 15, MIN_REP_SET, dict( label = _("Minimum reputation to vote up"), -- 2.39.5