# HG changeset patch # User Brian Neal # Date 1523732584 18000 # Node ID a1a223ab0c8f56bc113e2ca2eecb10e3e765f60d # Parent b957e4829a03f9a4e722c925d2c17a1b7cbeca5a Improve form error message when missing captcha response diff -r b957e4829a03 -r a1a223ab0c8f contact/forms.py --- a/contact/forms.py Sat Apr 14 13:53:05 2018 -0500 +++ b/contact/forms.py Sat Apr 14 14:03:04 2018 -0500 @@ -42,7 +42,7 @@ super(ContactForm, self).clean() captcha_response = self.request.POST.get('g-recaptcha-response') if not captcha_response: - raise forms.ValidationError('Missing reCAPTCHA response') + raise forms.ValidationError("Please verify you aren't a robot") r = requests.post(settings.RECAPTCHA_URL, data={ 'secret': settings.RECAPTCHA_SECRET_KEY, 'response': captcha_response, diff -r b957e4829a03 -r a1a223ab0c8f sg101/templates/contact/contact_form.html --- a/sg101/templates/contact/contact_form.html Sat Apr 14 13:53:05 2018 -0500 +++ b/sg101/templates/contact/contact_form.html Sat Apr 14 14:03:04 2018 -0500 @@ -10,6 +10,7 @@

{% csrf_token %} + {{ form.non_field_errors }}