MM-17496: Skip adding user to default channel (rather than failing) when user has already left the parent team. (#11790)

Этот коммит содержится в:
Martin Kraft
2019-08-07 18:09:23 -04:00
коммит произвёл Sudheer
родитель 4734215a11
Коммит 3056b192fe

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

@@ -57,7 +57,14 @@ func (a *App) CreateDefaultMemberships(since int64) error {
_, err = a.AddChannelMember(userChannel.UserID, channel, "", "")
if err != nil {
return err
if err.Id == "api.channel.add_user.to.channel.failed.deleted.app_error" {
a.Log.Info("Not adding user to channel because they have already left the team",
mlog.String("user_id", userChannel.UserID),
mlog.String("channel_id", userChannel.ChannelID),
)
} else {
return err
}
}
a.Log.Info("added channelmember",