Migrate GetDeletedByName from ChannelStore to return error interface (#14709)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-06-18 00:26:35 -04:00
коммит произвёл GitHub
родитель 1d9c8a490d
Коммит 8dc7c5762f
8 изменённых файлов: 15 добавлений и 25 удалений

Просмотреть файл

@@ -536,7 +536,7 @@ func (a *App) SlackAddChannels(teamId string, slackchannels []SlackChannel, post
if mChannel, err = a.Srv().Store.Channel().GetByName(teamId, sChannel.Name, true); err == nil {
// The channel already exists as an active channel. Merge with the existing one.
importerLog.WriteString(utils.T("api.slackimport.slack_add_channels.merge", map[string]interface{}{"DisplayName": newChannel.DisplayName}))
} else if _, err := a.Srv().Store.Channel().GetDeletedByName(teamId, sChannel.Name); err == nil {
} else if _, nErr := a.Srv().Store.Channel().GetDeletedByName(teamId, sChannel.Name); nErr == nil {
// The channel already exists but has been deleted. Generate a random string for the handle instead.
newChannel.Name = model.NewId()
newChannel = SlackSanitiseChannelProperties(newChannel)