From fa58bc340df4611a464adba8ba37252bfaaa53fd Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Mon, 23 Aug 2021 15:14:05 +0200 Subject: [PATCH] auth: Make the deactivated user error message clearer. --- zerver/forms.py | 2 +- zerver/tests/test_auth_backends.py | 2 +- zerver/tests/test_decorators.py | 4 ++-- zerver/tests/test_signup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zerver/forms.py b/zerver/forms.py index f9c02ba2e1..7598d3afd4 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -54,7 +54,7 @@ WRONG_SUBDOMAIN_ERROR = ( + "Please contact your organization administrator with any questions." ) DEACTIVATED_ACCOUNT_ERROR = ( - "Your account {username} is no longer active. " + "Your account {username} has been deactivated. " + "Please contact your organization administrator to reactivate it." ) PASSWORD_RESET_NEEDED_ERROR = ( diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py index ceab456140..e41dfe1240 100644 --- a/zerver/tests/test_auth_backends.py +++ b/zerver/tests/test_auth_backends.py @@ -1116,7 +1116,7 @@ class SocialAuthBase(DesktopFlowTestingLib, ZulipTestCase): result = self.client_get(result.url) self.assert_in_success_response( - [f"Your account {user_profile.delivery_email} is no longer active."], result + [f"Your account {user_profile.delivery_email} has been deactivated."], result ) def test_social_auth_invalid_realm(self) -> None: diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.py index 5228e1ee3b..67caeb1897 100644 --- a/zerver/tests/test_decorators.py +++ b/zerver/tests/test_decorators.py @@ -1220,7 +1220,7 @@ class InactiveUserTest(ZulipTestCase): result = self.login_with_return(user_profile.delivery_email) self.assert_in_response( - "Your account {} is no longer active.".format(user_profile.delivery_email), result + f"Your account {user_profile.delivery_email} has been deactivated.", result ) def test_login_deactivated_mirror_dummy(self) -> None: @@ -1263,7 +1263,7 @@ class InactiveUserTest(ZulipTestCase): with self.settings(AUTHENTICATION_BACKENDS=("zproject.backends.EmailAuthBackend",)): self.assertFalse(form.is_valid()) self.assertIn( - "Your account {} is no longer active".format(user_profile.delivery_email), + "Your account {} has been deactivated".format(user_profile.delivery_email), str(form.errors), ) diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 8c0803f44a..e8ad2ffebe 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -738,7 +738,7 @@ class LoginTest(ZulipTestCase): result = self.login_with_return(user_profile.delivery_email, "xxx") self.assertEqual(result.status_code, 200) self.assert_in_response( - "Your account {} is no longer active.".format(user_profile.delivery_email), result + f"Your account {user_profile.delivery_email} has been deactivated.", result ) self.assert_logged_in_user_id(None)