Skip to content

Commit

Permalink
Additional logging for recaptcha errors
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyu95 committed Oct 16, 2023
1 parent c632d8c commit 6faf098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ def technical_support():

if recaptcha_response['success'] is False or recaptcha_response['score'] < current_app.config[
"RECAPTCHA_THRESHOLD"]:
current_app.logger.exception("Recaptcha failed to verify response.\n\n{}".format(recaptcha_response))
flash('Recaptcha failed, please try again.', category='danger')
render_template('main/contact.html')
return render_template('main/contact.html')
except:
current_app.logger.exception("Recaptcha failed to get a response.")
flash('Recaptcha failed, please try again.', category='danger')
render_template('main/contact.html')
return render_template('main/contact.html')

name = request.form.get('name')
email = request.form.get('email')
Expand Down
1 change: 1 addition & 0 deletions app/request/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def new():

if recaptcha_response['success'] is False or recaptcha_response['score'] < current_app.config[
"RECAPTCHA_THRESHOLD"]:
current_app.logger.exception("Recaptcha failed to verify response.\n\n{}".format(recaptcha_response))
flash('Recaptcha failed, please try again.', category='danger')
return render_template(
new_request_template,
Expand Down

0 comments on commit 6faf098

Please sign in to comment.