Skip to content

Commit

Permalink
Change error text to be more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekj117 committed Jul 8, 2020
1 parent ae6ed94 commit 6fafa9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion securedrop/journalist_app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion securedrop/tests/functional/journalist_navigation_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6fafa9f

Please sign in to comment.