From 70c83435e9d3f2e30534a6f6c8c005cd309bfc12 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 28 May 2014 19:53:34 -0300 Subject: recaptcha seems to work --- askbot/conf/external_keys.py | 2 -- askbot/forms.py | 6 +++--- askbot/media/style/style.css | 4 ++++ askbot/media/style/style.less | 4 ++++ askbot/templates/answer_edit.html | 2 +- askbot/templates/question/new_answer_form.html | 2 +- askbot/templates/question_edit.html | 4 ++-- askbot/views/meta.py | 5 +---- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/askbot/conf/external_keys.py b/askbot/conf/external_keys.py index 3837b7ae..989cbf46 100644 --- a/askbot/conf/external_keys.py +++ b/askbot/conf/external_keys.py @@ -53,8 +53,6 @@ settings.register( ) ) - - settings.register( livesettings.StringValue( EXTERNAL_KEYS, diff --git a/askbot/forms.py b/askbot/forms.py index 550f6f14..e218f381 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -746,9 +746,9 @@ class FeedbackForm(forms.Form): ) next = NextUrlField() - def __init__(self, user=False, *args, **kwargs): + def __init__(self, user=None, *args, **kwargs): super(FeedbackForm, self).__init__(*args, **kwargs) - self.user = user.is_authenticated() + self.user = user if should_use_recaptcha(user): self.fields['recaptcha'] = AskbotRecaptchaField() @@ -760,7 +760,7 @@ class FeedbackForm(forms.Form): def clean(self): super(FeedbackForm, self).clean() - if self.user.is_anonymous(): + if self.user and self.user.is_anonymous(): if not self.cleaned_data['no_email'] \ and not self.cleaned_data['email']: msg = _('Please mark "I dont want to give my mail" field.') diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css index e1787790..a1c0751f 100644 --- a/askbot/media/style/style.css +++ b/askbot/media/style/style.css @@ -4360,6 +4360,10 @@ td.setting-input textarea { -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; } +#recaptcha_area, +#recaptcha_table { + line-height: 0!important; +} .acInput { width: 200px; } diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less index 748591df..26f73627 100644 --- a/askbot/media/style/style.less +++ b/askbot/media/style/style.less @@ -4574,6 +4574,10 @@ td.setting-input { } } +#recaptcha_area, #recaptcha_table { + line-height: 0!important; +} + .acInput { width: 200px; } diff --git a/askbot/templates/answer_edit.html b/askbot/templates/answer_edit.html index bb43b83d..5ba0881b 100644 --- a/askbot/templates/answer_edit.html +++ b/askbot/templates/answer_edit.html @@ -22,7 +22,7 @@ ) }} {% if form.recaptcha %} -
{{ macros.form_fild_with_errors(form.recaptcha) }}
+
{{ macros.form_field_with_errors(form.recaptcha) }}
{% endif %}
diff --git a/askbot/templates/question/new_answer_form.html b/askbot/templates/question/new_answer_form.html index ae12738a..9e8644d4 100644 --- a/askbot/templates/question/new_answer_form.html +++ b/askbot/templates/question/new_answer_form.html @@ -42,7 +42,7 @@ ) }} {% if answer.recaptcha %} -
{{ macros.form_fild_with_errors(answer.recaptcha) }}
+
{{ macros.form_field_with_errors(answer.recaptcha) }}
{% endif %} diff --git a/askbot/templates/question_edit.html b/askbot/templates/question_edit.html index db251fe6..f6de6bdf 100644 --- a/askbot/templates/question_edit.html +++ b/askbot/templates/question_edit.html @@ -36,7 +36,7 @@ }}
{% if form.recaptcha %} -
{{ macros.form_fild_with_errors(form.recaptcha) }}
+
{{ macros.form_field_with_errors(form.recaptcha) }}
{% endif %}
@@ -62,7 +62,7 @@
{% endif %}
-   +
diff --git a/askbot/views/meta.py b/askbot/views/meta.py index 82a9e741..a27f2971 100644 --- a/askbot/views/meta.py +++ b/askbot/views/meta.py @@ -107,10 +107,7 @@ def feedback(request): return HttpResponseRedirect(redirect_url) if request.method == "POST": - form = FeedbackForm( - is_auth=request.user.is_authenticated(), - data=request.POST - ) + form = FeedbackForm(user=request.user, data=request.POST) if form.is_valid(): if not request.user.is_authenticated(): -- cgit v1.2.3-1-g7c22