Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

auth: Make the deactivated user error message clearer.

Mateusz Manderafa58bc340df4
diff --git a/zerver/forms.py b/zerver/forms.py
index f9c02ba2e17..7598d3afd42 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 ceab4561402..e41dfe12401 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 5228e1ee3b7..67caeb1897f 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 8c0803f44ab..e8ad2ffebed 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)