diff --git a/securedrop/journalist_app/forms.py b/securedrop/journalist_app/forms.py index 3c048a9ff3..05cee4bfa5 100644 --- a/securedrop/journalist_app/forms.py +++ b/securedrop/journalist_app/forms.py @@ -40,7 +40,7 @@ def name_length_validation(form, field): def check_invalid_usernames(form, field): if field.data in Journalist.INVALID_USERNAMES: raise ValidationError(gettext( - "Invalid username")) + "This username is invalid because it is reserved for internal use by the software.")) class NewUserForm(FlaskForm): diff --git a/securedrop/tests/functional/journalist_navigation_steps.py b/securedrop/tests/functional/journalist_navigation_steps.py index aaad7540e9..a237bfc104 100644 --- a/securedrop/tests/functional/journalist_navigation_steps.py +++ b/securedrop/tests/functional/journalist_navigation_steps.py @@ -341,7 +341,7 @@ def _admin_adds_a_user_with_invalid_username(self): self.wait_for(lambda: self.driver.find_element_by_css_selector(".form-validation-error")) error_msg = self.driver.find_element_by_css_selector(".form-validation-error") - assert "Invalid username" in error_msg.text + assert "This username is invalid because it is reserved for internal use by the software." in error_msg.text def _admin_adds_a_user(self, is_admin=False, new_username=""): self.safe_click_by_id("add-user")