Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
settings: Don't mention username in fetch API key error message.
jai2201c14b3a8844b7
diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.pyindex 5bb5f9e25c8..ae849527550 100644--- a/zerver/tests/test_auth_backends.py+++ b/zerver/tests/test_auth_backends.py@@ -4345,7 +4345,7 @@ class JSONFetchAPIKeyTest(ZulipTestCase):user = self.example_user("hamlet")self.login_user(user)result = self.client_post("/json/fetch_api_key", dict(password="wrong"))- self.assert_json_error(result, "Your username or password is incorrect.", 400)+ self.assert_json_error(result, "Password is incorrect.", 400)def test_invalid_subdomain(self) -> None:username = "hamlet"diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.pyindex f460f63618f..bb862a5c381 100644--- a/zerver/tests/test_decorators.py+++ b/zerver/tests/test_decorators.py@@ -1143,7 +1143,7 @@ class FetchAPIKeyTest(ZulipTestCase):def test_fetch_api_key_wrong_password(self) -> None:self.login("cordelia")result = self.client_post("/json/fetch_api_key", dict(password="wrong_password"))- self.assert_json_error_contains(result, "password is incorrect")+ self.assert_json_error_contains(result, "Password is incorrect")class InactiveUserTest(ZulipTestCase):diff --git a/zerver/views/auth.py b/zerver/views/auth.pyindex 9d242cff95f..501848c15ff 100644--- a/zerver/views/auth.py+++ b/zerver/views/auth.py@@ -977,7 +977,7 @@ def json_fetch_api_key(if not authenticate(request=request, username=user_profile.delivery_email, password=password, realm=realm):- raise JsonableError(_("Your username or password is incorrect."))+ raise JsonableError(_("Password is incorrect."))api_key = get_api_key(user_profile)return json_success({"api_key": api_key, "email": user_profile.delivery_email})