Switch creation of users to use app method vs client method (#16673)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5a7759f4d6
Коммит
81b06b5b72
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
UserPassword = "passwd"
|
||||
UserPassword = "Usr@MMTest123"
|
||||
ChannelType = model.CHANNEL_OPEN
|
||||
BTestTeamDisplayName = "TestTeam"
|
||||
BTestTeamName = "z-z-testdomaina"
|
||||
|
||||
@@ -93,9 +93,9 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, error) {
|
||||
Nickname: userName,
|
||||
Password: UserPassword}
|
||||
|
||||
ruser, resp := cfg.client.CreateUserWithInviteId(user, cfg.team.InviteId)
|
||||
if resp.Error != nil {
|
||||
return nil, resp.Error
|
||||
ruser, appErr := cfg.app.CreateUserWithInviteId(user, cfg.team.InviteId, "")
|
||||
if appErr != nil {
|
||||
return nil, appErr
|
||||
}
|
||||
|
||||
status := &model.Status{UserId: ruser.Id, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""}
|
||||
|
||||
@@ -294,7 +294,9 @@ func (*LoadTestProvider) UsersCommand(a *app.App, args *model.CommandArgs, messa
|
||||
client := model.NewAPIv4Client(args.SiteURL)
|
||||
userCreator := NewAutoUserCreator(a, client, team)
|
||||
userCreator.Fuzzy = doFuzz
|
||||
userCreator.CreateTestUsers(usersr)
|
||||
if _, err := userCreator.CreateTestUsers(usersr); err != nil {
|
||||
return &model.CommandResponse{Text: "Failed to add users: " + err.Error(), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, err
|
||||
}
|
||||
|
||||
return &model.CommandResponse{Text: "Added users", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user