Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 4 years ago
parent
commit
adb0bd1d9e
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      routers/repo/ai_model_manage.go

+ 12
- 1
routers/repo/ai_model_manage.go View File

@@ -476,7 +476,18 @@ func ModifyModelInfo(ctx *context.Context) {
id := ctx.Query("ID")
description := ctx.Query("Description")

err := ModifyModel(id, description)
task, err := models.QueryModelById(id)
if err != nil {
log.Error("no such model!", err.Error())
ctx.ServerError("no such model:", err)
return
}
if !isCanDeleteOrDownload(ctx, task) {
ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright")))
return
}

err = ModifyModel(id, description)

if err == nil {
ctx.HTML(200, "success")


Loading…
Cancel
Save