mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-18830] Unhelpful error message when adding bot to a channel before adding to team (#12844)
* Fix error message * Rename User to Username * Add '@' to the username
This commit is contained in:
@@ -143,6 +143,10 @@ func (me *InviteProvider) DoCommand(a *App, args *model.CommandArgs, message str
|
||||
var text string
|
||||
if err.Id == "api.channel.add_members.user_denied" {
|
||||
text = args.T("api.command_invite.group_constrained_user_denied")
|
||||
} else if err.Id == "store.sql_team.get_member.missing.app_error" {
|
||||
text = args.T("api.command_invite.user_not_in_team.app_error", map[string]interface{}{
|
||||
"Username": userProfile.Username,
|
||||
})
|
||||
} else {
|
||||
text = args.T("api.command_invite.fail.app_error")
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ func TestInviteProvider(t *testing.T) {
|
||||
},
|
||||
{
|
||||
desc: "try to add a user which is not part of the team",
|
||||
expected: "api.command_invite.fail.app_error",
|
||||
expected: "api.command_invite.user_not_in_team.app_error",
|
||||
msg: basicUser4.Username,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -798,6 +798,10 @@
|
||||
"id": "api.command_invite.user_already_in_channel.app_error",
|
||||
"translation": "{{.User}} is already in the channel."
|
||||
},
|
||||
{
|
||||
"id": "api.command_invite.user_not_in_team.app_error",
|
||||
"translation": "@{{.Username}} is not a member of the team."
|
||||
},
|
||||
{
|
||||
"id": "api.command_invite_people.permission.app_error",
|
||||
"translation": "You don't have permission to invite new users to this server."
|
||||
|
||||
Reference in New Issue
Block a user