Use get to avoid KeyErrors

This commit is contained in:
David Baker 2016-07-22 17:18:50 +01:00
parent dad2da7e54
commit 7ed58bb347

View File

@ -286,7 +286,7 @@ class AuthHandler(BaseHandler):
logger.info(
"%s reCAPTCHA from hostname %s",
"Successful" if resp_body['success'] else "Failed",
resp_body['hostname']
resp_body.get('hostname')
)
if resp_body['success']:
defer.returnValue(True)