Change "foo@example.org is not available" message to "foo@example.org is already registed".

This commit is contained in:
Pēteris Caune 2018-10-03 10:52:51 +03:00
parent 75fa27436e
commit 621e04e845
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class ChangeEmailForm(forms.Form):
def clean_email(self):
v = self.cleaned_data["email"]
if User.objects.filter(email=v).exists():
raise forms.ValidationError("%s is not available" % v)
raise forms.ValidationError("%s is already registered" % v)
return v

View File

@ -35,7 +35,7 @@ class ChangeEmailTestCase(BaseTestCase):
payload = {"email": "bob@example.org"}
r = self.client.post("/accounts/change_email/foo/", payload)
self.assertContains(r, "bob@example.org is not available")
self.assertContains(r, "bob@example.org is already registered")
self.alice.refresh_from_db()
self.assertEqual(self.alice.email, "alice@example.org")