From 2b5a191fb749aeaf7795b2e421ebf4b191fe7f30 Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Mon, 15 Apr 2019 14:07:12 +0300 Subject: [PATCH] Fix recaptcha --- ckan/lib/captcha.py | 2 +- ckan/templates/user/snippets/recaptcha.html | 36 ++++++++------------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/ckan/lib/captcha.py b/ckan/lib/captcha.py index 9ba1ce01c4d..9a138dff1d7 100644 --- a/ckan/lib/captcha.py +++ b/ckan/lib/captcha.py @@ -17,7 +17,7 @@ def check_recaptcha(request): client_ip_address = request.environ.get('REMOTE_ADDR', 'Unknown IP Address') # reCAPTCHA v2 - recaptcha_response_field = request.params.get('g-recaptcha-response', '') + recaptcha_response_field = request.form.get('g-recaptcha-response', '') recaptcha_server_name = 'https://www.google.com/recaptcha/api/siteverify' # recaptcha_response_field will be unicode if there are foreign chars in diff --git a/ckan/templates/user/snippets/recaptcha.html b/ckan/templates/user/snippets/recaptcha.html index c74362caa81..2807ddf59be 100644 --- a/ckan/templates/user/snippets/recaptcha.html +++ b/ckan/templates/user/snippets/recaptcha.html @@ -1,28 +1,18 @@
- {% if g.recaptcha_version == '1' %} - - - - {% elif g.recaptcha_version == '2' %} - -
- -