MM-14723: Add config flag for creating bots (#10795)
* MM-14723 add config flag for creating bots * MM-14723 - update i18n to handle new config flag * MM-14723 - change API tests to allow bots by default * Update i18n/en.json Co-Authored-By: andresoro <ao15@my.fsu.edu> * MM-14723: add config flag for enabling/disabling bot creation * undo changes to apitestlib.go to explicitly change config in each test * add unit tests for config changes * MM-14723 update test cases * MM-14723 update test cases to use UpdateConfig method
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
b3aa3d4567
Коммит
30061df036
@@ -36,6 +36,11 @@ func createBot(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !*c.App.Config().ServiceSettings.CreateBotAccounts {
|
||||
c.Err = model.NewAppError("createBot", "api.bot.create_disabled", nil, "", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
createdBot, err := c.App.CreateBot(bot)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
|
||||
Ссылка в новой задаче
Block a user