From 68a6ceec78496bf395de0eb2293adb5921475eac Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 27 Sep 2016 11:37:20 +0100 Subject: [PATCH] Give better error message for blacklisted password MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Telling the user what to do, rather than the mistake they’ve made is usually better. --- app/main/forms.py | 2 +- tests/app/main/test_validators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index 3d13c3b38..496b2fd86 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -73,7 +73,7 @@ def password(label='Password'): return PasswordField(label, validators=[DataRequired(message='Can’t be empty'), Length(8, 255, message='Must be at least 8 characters'), - Blacklist(message='That password is blacklisted, too common')]) + Blacklist(message='Choose a password that’s harder to guess')]) def sms_code(): diff --git a/tests/app/main/test_validators.py b/tests/app/main/test_validators.py index 05a7f020a..85661d4f2 100644 --- a/tests/app/main/test_validators.py +++ b/tests/app/main/test_validators.py @@ -17,7 +17,7 @@ def test_should_raise_validation_error_for_password(app_, mock_get_user_by_email form.password.data = password form.validate() - assert 'That password is blacklisted, too common' in form.errors['password'] + assert 'Choose a password that’s harder to guess' in form.errors['password'] def test_valid_email_not_in_valid_domains(app_):