mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
remove redundant getUser call (#24198)
This commit is contained in:
parent
dec13f8c9c
commit
4ef9384d74
@ -12,6 +12,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/i18n"
|
||||
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
||||
|
||||
"github.com/mattermost/mattermost/server/v8/channels/app/request"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/product"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
@ -153,11 +154,7 @@ func (a *App) CreateBot(c request.CTX, bot *model.Bot) (*model.Bot, *model.AppEr
|
||||
} else if ownerUser != nil {
|
||||
// Send a message to the bot's creator to inform them that the bot needs to be added
|
||||
// to a team and channel after it's created
|
||||
botOwner, err := a.GetUser(bot.OwnerId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
channel, err := a.getOrCreateDirectChannelWithUser(c, user, botOwner)
|
||||
channel, err := a.getOrCreateDirectChannelWithUser(c, user, ownerUser)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user