From 621e04e84564570b6afe43b1bc6f36f16d1e641e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 3 Oct 2018 10:52:51 +0300 Subject: [PATCH] Change "foo@example.org is not available" message to "foo@example.org is already registed". --- hc/accounts/forms.py | 2 +- hc/accounts/tests/test_change_email.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hc/accounts/forms.py b/hc/accounts/forms.py index 6371c250..c1aca20e 100644 --- a/hc/accounts/forms.py +++ b/hc/accounts/forms.py @@ -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 diff --git a/hc/accounts/tests/test_change_email.py b/hc/accounts/tests/test_change_email.py index 523bb868..a5ad15eb 100644 --- a/hc/accounts/tests/test_change_email.py +++ b/hc/accounts/tests/test_change_email.py @@ -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")