Allow non-gov email addresses to be changed to gov email addresses

When a user's email address is updated, we not allowing it to be changed
to a non-government email address. We now allow a non-gov email address
to be changed to another non-gov email address. Government email
addresses still cannot be changed to non-government email addresses.

Also fixes the link in the error message on the ChangeEmailAddress form -
this was being escaped before.
This commit is contained in:
Katie Smith
2019-04-18 16:03:13 +01:00
parent 33aa16661e
commit d689b031a2
4 changed files with 84 additions and 3 deletions

View File

@@ -716,6 +716,10 @@ class ChangeEmailForm(StripWhitespaceForm):
raise ValidationError("The email address is already in use")
class ChangeNonGovEmailForm(ChangeEmailForm):
email_address = email_address(gov_user=False)
class ChangeMobileNumberForm(StripWhitespaceForm):
mobile_number = international_phone_number()