MM-17006: An http 404 response code is returned when deleting a non existent plugin (#11631)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
mattermod
родитель
c68f021809
Коммит
75c4fcb87e
@@ -181,11 +181,11 @@ func TestPlugin(t *testing.T) {
|
|||||||
|
|
||||||
// Activate error case
|
// Activate error case
|
||||||
ok, resp = th.SystemAdminClient.EnablePlugin("junk")
|
ok, resp = th.SystemAdminClient.EnablePlugin("junk")
|
||||||
CheckBadRequestStatus(t, resp)
|
CheckNotFoundStatus(t, resp)
|
||||||
assert.False(t, ok)
|
assert.False(t, ok)
|
||||||
|
|
||||||
ok, resp = th.SystemAdminClient.EnablePlugin("JUNK")
|
ok, resp = th.SystemAdminClient.EnablePlugin("JUNK")
|
||||||
CheckBadRequestStatus(t, resp)
|
CheckNotFoundStatus(t, resp)
|
||||||
assert.False(t, ok)
|
assert.False(t, ok)
|
||||||
|
|
||||||
// Successful deactivate
|
// Successful deactivate
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ func (a *App) EnablePlugin(id string) *model.AppError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if manifest == nil {
|
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) {
|
a.UpdateConfig(func(cfg *model.Config) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func (a *App) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError)
|
|||||||
return status, nil
|
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.
|
// GetPluginStatuses returns the status for plugins installed on this server.
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user