mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Merge pull request #1360 from JasonGhent/patch-1
Respect ENFORCE_SIGNUP_CAPTCHA in profile signup
This commit is contained in:
commit
90bc14919d
1 changed files with 11 additions and 10 deletions
|
@ -108,16 +108,17 @@ def signup(request):
|
|||
recaptcha = request.POST.get('g-recaptcha-response', None)
|
||||
recaptcha_error = None
|
||||
|
||||
if not recaptcha:
|
||||
recaptcha_error = "Please hit the \"I'm not a robot\" button."
|
||||
else:
|
||||
response = requests.post('https://www.google.com/recaptcha/api/siteverify', {
|
||||
'secret': settings.RECAPTCHA_SECRET_KEY,
|
||||
'response': recaptcha,
|
||||
})
|
||||
result = response.json()
|
||||
if not result['success']:
|
||||
recaptcha_error = "Really, please hit the \"I'm not a robot\" button."
|
||||
if settings.ENFORCE_SIGNUP_CAPTCHA:
|
||||
if not recaptcha:
|
||||
recaptcha_error = "Please hit the \"I'm not a robot\" button."
|
||||
else:
|
||||
response = requests.post('https://www.google.com/recaptcha/api/siteverify', {
|
||||
'secret': settings.RECAPTCHA_SECRET_KEY,
|
||||
'response': recaptcha,
|
||||
})
|
||||
result = response.json()
|
||||
if not result['success']:
|
||||
recaptcha_error = "Really, please hit the \"I'm not a robot\" button."
|
||||
|
||||
if request.method == "POST":
|
||||
form = SignupForm(data=request.POST, prefix="signup")
|
||||
|
|
Loading…
Add table
Reference in a new issue