invites: Update translated errors for stream to channel rename.

In zerver/views/invite.py, updates translated errors strings to
use channel instead of stream.

Part of stream to channel rename project.
This commit is contained in:
Lauryn Menard 2024-04-17 18:18:56 +02:00 committed by Tim Abbott
parent 9aaddc6231
commit df3ab8deea
3 changed files with 12 additions and 12 deletions

View File

@ -12049,7 +12049,7 @@ paths:
- example:
{
"code": "BAD_REQUEST",
"msg": "Stream does not exist with id: 11. No invites were sent.",
"msg": "Invalid channel ID 11. No invites were sent.",
"result": "error",
}
description: |
@ -12061,7 +12061,7 @@ paths:
- example:
{
"code": "BAD_REQUEST",
"msg": "You do not have permission to subscribe other users to streams.",
"msg": "You do not have permission to subscribe other users to channels.",
"result": "error",
}
description: |
@ -12162,7 +12162,7 @@ paths:
- example:
{
"code": "BAD_REQUEST",
"msg": "Invalid stream ID 11. No invites were sent.",
"msg": "Invalid channel ID 11. No invites were sent.",
"result": "error",
}
description: |
@ -12174,7 +12174,7 @@ paths:
- example:
{
"code": "BAD_REQUEST",
"msg": "You do not have permission to subscribe other users to streams.",
"msg": "You do not have permission to subscribe other users to channels.",
"result": "error",
}
description: |

View File

@ -1044,7 +1044,7 @@ earl-test@zulip.com""",
self.login("hamlet")
self.assert_json_error(
self.invite("iago-test@zulip.com", ["NotARealStream"]),
f"Stream does not exist with id: {self.INVALID_STREAM_ID}. No invites were sent.",
f"Invalid channel ID {self.INVALID_STREAM_ID}. No invites were sent.",
)
self.check_sent_emails([])
@ -1293,7 +1293,7 @@ so we didn't send them an invitation. We did send invitations to everyone else!"
self.login("hamlet")
result = self.invite(invitee, ["Denmark", "Scotland"])
self.assert_json_error(
result, "You do not have permission to subscribe other users to streams."
result, "You do not have permission to subscribe other users to channels."
)
result = self.invite(invitee, [])
@ -2487,7 +2487,7 @@ class MultiuseInviteTest(ZulipTestCase):
},
)
self.assert_json_error(
result, "You do not have permission to subscribe other users to streams."
result, "You do not have permission to subscribe other users to channels."
)
result = self.client_post(
@ -2682,7 +2682,7 @@ class MultiuseInviteTest(ZulipTestCase):
"invite_expires_in_minutes": 2 * 24 * 60,
},
)
self.assert_json_error(result, "Invalid stream ID 54321. No invites were sent.")
self.assert_json_error(result, "Invalid channel ID 54321. No invites were sent.")
def test_create_multiuse_link_invalid_invite_as_api_call(self) -> None:
self.login("iago")

View File

@ -84,14 +84,14 @@ def invite_users_backend(
(stream, sub) = access_stream_by_id(user_profile, stream_id)
except JsonableError:
raise JsonableError(
_("Stream does not exist with id: {channel_id}. No invites were sent.").format(
_("Invalid channel ID {channel_id}. No invites were sent.").format(
channel_id=stream_id
)
)
streams.append(stream)
if len(streams) and not user_profile.can_subscribe_other_users():
raise JsonableError(_("You do not have permission to subscribe other users to streams."))
raise JsonableError(_("You do not have permission to subscribe other users to channels."))
do_invite_users(
user_profile,
@ -221,14 +221,14 @@ def generate_multiuse_invite_backend(
(stream, sub) = access_stream_by_id(user_profile, stream_id)
except JsonableError:
raise JsonableError(
_("Invalid stream ID {channel_id}. No invites were sent.").format(
_("Invalid channel ID {channel_id}. No invites were sent.").format(
channel_id=stream_id
)
)
streams.append(stream)
if len(streams) and not user_profile.can_subscribe_other_users():
raise JsonableError(_("You do not have permission to subscribe other users to streams."))
raise JsonableError(_("You do not have permission to subscribe other users to channels."))
invite_link = do_create_multiuse_invite_link(
user_profile, invite_as, invite_expires_in_minutes, streams