Skip to content

Commit

Permalink
Merge d23c3e4 into 8879e98
Browse files Browse the repository at this point in the history
  • Loading branch information
mdugas committed Jun 20, 2015
2 parents 8879e98 + d23c3e4 commit d918f4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flask_wtf/recaptcha/validators.py
Expand Up @@ -70,8 +70,9 @@ def _validate_recaptcha(self, response, remote_addr):
if json_resp["success"]:
return True

for error in json_resp.get("error-codes", []):
if error in RECAPTCHA_ERROR_CODES:
raise ValidationError(RECAPTCHA_ERROR_CODES[error])
if "error-codes" in json_resp:
for error in json_resp.get("error-codes", []):
if error in RECAPTCHA_ERROR_CODES:
raise ValidationError(RECAPTCHA_ERROR_CODES[error])

return False

0 comments on commit d918f4c

Please sign in to comment.