summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-05-28 19:53:34 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-05-28 19:53:34 -0300
commit70c83435e9d3f2e30534a6f6c8c005cd309bfc12 (patch)
treeeaab708e6420a2efa3e54b01b081e78ddd52cc63
parent1f96403bf11a2dd7405fc905afd7d906380b4dba (diff)
downloadaskbot-70c83435e9d3f2e30534a6f6c8c005cd309bfc12.tar.gz
askbot-70c83435e9d3f2e30534a6f6c8c005cd309bfc12.tar.bz2
askbot-70c83435e9d3f2e30534a6f6c8c005cd309bfc12.zip
recaptcha seems to work
-rw-r--r--askbot/conf/external_keys.py2
-rw-r--r--askbot/forms.py6
-rw-r--r--askbot/media/style/style.css4
-rw-r--r--askbot/media/style/style.less4
-rw-r--r--askbot/templates/answer_edit.html2
-rw-r--r--askbot/templates/question/new_answer_form.html2
-rw-r--r--askbot/templates/question_edit.html4
-rw-r--r--askbot/views/meta.py5
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 %}
- <div>{{ macros.form_fild_with_errors(form.recaptcha) }}</div>
+ <div>{{ macros.form_field_with_errors(form.recaptcha) }}</div>
<div class="clearfix"></div>
{% endif %}
<div class="answer-options">
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 %}
- <div>{{ macros.form_fild_with_errors(answer.recaptcha) }}</div>
+ <div>{{ macros.form_field_with_errors(answer.recaptcha) }}</div>
<div class="clearfix"></div>
{% endif %}
<input id="add-answer-btn" type="submit" class="submit after-editor" style="float:left"/>
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 @@
}}
<div class="after-editor">
{% if form.recaptcha %}
- <div>{{ macros.form_fild_with_errors(form.recaptcha) }}</div>
+ <div>{{ macros.form_field_with_errors(form.recaptcha) }}</div>
<div class="clearfix"></div>
{% endif %}
<div class="question-options">
@@ -62,7 +62,7 @@
</div>
{% endif %}
</div>
- <input id="edit_post_form_submit_button" type="submit" value="{% trans %}Save edit{% endtrans %}" class="large submit" />&nbsp;
+ <input id="edit_post_form_submit_button" type="submit" value="{% trans %}Save edit{% endtrans %}" class="large submit" />
<input type="button" value="{% trans %}Cancel{% endtrans %}" class="large submit" onclick="history.back(-1);" />
</div>
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():