Migrate User.Save to Sync by default (#11482)
* Migrate User.Save to Sync by default * Make error testing more explicit * Factor out else * Fix some merge-related bugs * Add some missing nil err test requirements * Improve function signature * Remove unused time import * More test fixups
Этот коммит содержится в:
коммит произвёл
Gabe Jackson
родитель
d15c2c4e69
Коммит
15c3c5f9e6
@@ -16,11 +16,11 @@ import (
|
||||
|
||||
// CreateBot creates the given bot and corresponding user.
|
||||
func (a *App) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) {
|
||||
result := <-a.Srv.Store.User().Save(model.UserFromBot(bot))
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
user, err := a.Srv.Store.User().Save(model.UserFromBot(bot))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bot.UserId = result.Data.(*model.User).Id
|
||||
bot.UserId = user.Id
|
||||
|
||||
savedBot, err := a.Srv.Store.Bot().Save(bot)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user