diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index eda5f0d4dc..a490324f5a 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -2063,7 +2063,7 @@ def validate_user_access_to_subscribers_helper(user_profile: Optional[UserProfil raise ValidationError("Requesting user not in given realm") if user_profile.realm.is_zephyr_mirror_realm and not stream_dict["invite_only"]: - raise JsonableError(_("You cannot get subscribers for public streams in this realm")) + raise JsonableError(_("Subscriber data is not available for this stream")) if (stream_dict["invite_only"] and not check_user_subscribed()): raise JsonableError(_("Unable to retrieve subscribers for invite-only stream")) diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py index e671ad06a5..f1e0416e47 100644 --- a/zerver/tests/test_auth_backends.py +++ b/zerver/tests/test_auth_backends.py @@ -1659,7 +1659,7 @@ class TestJWTLogin(ZulipTestCase): web_token = jwt.encode(payload, auth_key).decode('utf8') data = {'json_web_token': web_token} result = self.client_post('/accounts/login/jwt/', data) - self.assert_json_error_contains(result, "No realm specified in JSON web token claims", 400) + self.assert_json_error_contains(result, "No organization specified in JSON web token claims", 400) def test_login_failure_when_key_does_not_exist(self) -> None: data = {'json_web_token': 'not relevant'} diff --git a/zerver/tests/test_users.py b/zerver/tests/test_users.py index 2ec1bb6267..7de0024e5d 100644 --- a/zerver/tests/test_users.py +++ b/zerver/tests/test_users.py @@ -220,7 +220,7 @@ class AdminCreateUserTest(ZulipTestCase): short_name='Romeo', )) self.assert_json_error(result, - "Email 'romeo@not-zulip.com' not allowed for realm 'zulip'") + "Email 'romeo@not-zulip.com' not allowed in this organization") RealmDomain.objects.create(realm=get_realm('zulip'), domain='zulip.net') diff --git a/zerver/views/auth.py b/zerver/views/auth.py index cac5b6aef0..a1307a3b86 100644 --- a/zerver/views/auth.py +++ b/zerver/views/auth.py @@ -231,7 +231,7 @@ def remote_user_jwt(request: HttpRequest) -> HttpResponse: raise JsonableError(_("No user specified in JSON web token claims")) email_domain = payload.get('realm', None) if email_domain is None: - raise JsonableError(_("No realm specified in JSON web token claims")) + raise JsonableError(_("No organization specified in JSON web token claims")) email = "%s@%s" % (remote_user, email_domain) diff --git a/zerver/views/users.py b/zerver/views/users.py index 8245015a1b..57a90e8af9 100644 --- a/zerver/views/users.py +++ b/zerver/views/users.py @@ -453,8 +453,8 @@ def create_user_backend(request: HttpRequest, user_profile: UserProfile, # invited first.) realm = user_profile.realm if not email_allowed_for_realm(email, user_profile.realm): - return json_error(_("Email '%(email)s' not allowed for realm '%(realm)s'") % - {'email': email, 'realm': realm.string_id}) + return json_error(_("Email '%(email)s' not allowed in this organization") % + {'email': email}) try: get_user(email, user_profile.realm)