MM-17006: An http 404 response code is returned when deleting a non existent plugin (#11631)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca Vásquez
2019-11-26 08:36:51 -03:00
коммит произвёл mattermod
родитель c68f021809
Коммит 75c4fcb87e
3 изменённых файлов: 4 добавлений и 4 удалений

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

@@ -181,11 +181,11 @@ func TestPlugin(t *testing.T) {
// Activate error case
ok, resp = th.SystemAdminClient.EnablePlugin("junk")
CheckBadRequestStatus(t, resp)
CheckNotFoundStatus(t, resp)
assert.False(t, ok)
ok, resp = th.SystemAdminClient.EnablePlugin("JUNK")
CheckBadRequestStatus(t, resp)
CheckNotFoundStatus(t, resp)
assert.False(t, ok)
// Successful deactivate

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

@@ -334,7 +334,7 @@ func (a *App) EnablePlugin(id string) *model.AppError {
}
if manifest == nil {
return model.NewAppError("EnablePlugin", "app.plugin.not_installed.app_error", nil, "", http.StatusBadRequest)
return model.NewAppError("EnablePlugin", "app.plugin.not_installed.app_error", nil, "", http.StatusNotFound)
}
a.UpdateConfig(func(cfg *model.Config) {

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

@@ -28,7 +28,7 @@ func (a *App) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError)
return status, nil
}
}
return nil, model.NewAppError("GetPluginStatus", "app.plugin.not_installed.app_error", nil, "", http.StatusBadRequest)
return nil, model.NewAppError("GetPluginStatus", "app.plugin.not_installed.app_error", nil, "", http.StatusNotFound)
}
// GetPluginStatuses returns the status for plugins installed on this server.