mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-09 11:54:14 -04:00
We use the `ChangeEmailForm` if you want to change your own email address or someone else's email address. This has various validators which get run. We check if the email address is valid (by using a function from utils) and if the email address is already in use (by calling API). If the email address is not valid, we should not call API to see if it's already in use because this will cause an exception in API leading to a `500` in admin. We now only call API if there were no other errors with the email address. (The `test_should_redirect_after_name_change` test didn't need the `mock_email_is_not_already_in_use` fixture, so this has been removed.)