From 3ef231f42d6b4d94e7cad81053e29d2dc7e7a331 Mon Sep 17 00:00:00 2001 From: jordan Date: Fri, 27 Apr 2012 22:19:01 +0000 Subject: [PATCH] show the recaptcha field to unauthenticated users without a metter what is the min rep setting git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1259 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/forms/qanda.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/forum/forms/qanda.py b/forum/forms/qanda.py index 3679602..d2cc837 100644 --- a/forum/forms/qanda.py +++ b/forum/forms/qanda.py @@ -180,7 +180,7 @@ 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): + if not user.is_authenticated() or (int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff)): spam_fields = call_all_handlers('create_anti_spam_field') if spam_fields: spam_fields = dict(spam_fields) @@ -201,7 +201,7 @@ 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): + if not user.is_authenticated() or (int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff)): spam_fields = call_all_handlers('create_anti_spam_field') if spam_fields: spam_fields = dict(spam_fields) @@ -257,7 +257,7 @@ 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): + if not user.is_authenticated() or (int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff)): spam_fields = call_all_handlers('create_anti_spam_field') if spam_fields: spam_fields = dict(spam_fields) @@ -283,7 +283,7 @@ 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): + if not user.is_authenticated() or (int(user.reputation) < settings.CAPTCHA_IF_REP_LESS_THAN and not (user.is_superuser or user.is_staff)): spam_fields = call_all_handlers('create_anti_spam_field') if spam_fields: spam_fields = dict(spam_fields) -- 2.39.5