diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 76702a8b2..574cdbc5a 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -472,7 +472,7 @@ func ModifyModel(id string, description string) error { } func ModifyModelInfo(ctx *context.Context) { - log.Info("delete model start.") + log.Info("modify model start.") id := ctx.Query("ID") description := ctx.Query("Description") @@ -489,10 +489,11 @@ func ModifyModelInfo(ctx *context.Context) { err = ModifyModel(id, description) - if err == nil { - ctx.HTML(200, "success") + if err != nil { + log.Info("modify error," + err.Error()) + ctx.ServerError("error.", err) } else { - ctx.HTML(500, "Failed.") + ctx.JSON(200, "success") } }