Browse Source

提交修改代码,判断当前修改名称逻辑有问题。

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

+ 11
- 3
routers/repo/ai_model_manage.go View File

@@ -1057,9 +1057,17 @@ func ModifyModelInfo(ctx *context.Context) {
engine := ctx.QueryInt("engine")
aimodels := models.QueryModelByName(name, task.RepoId)
if aimodels != nil && len(aimodels) > 0 {
re["msg"] = ctx.Tr("repo.model.manage.create_error")
ctx.JSON(200, re)
return
if len(aimodels) == 1 {
if aimodels[0].ID != task.ID {
re["msg"] = ctx.Tr("repo.model.manage.create_error")
ctx.JSON(200, re)
return
}
} else {
re["msg"] = ctx.Tr("repo.model.manage.create_error")
ctx.JSON(200, re)
return
}
}
err = models.ModifyLocalModel(id, name, label, description, engine)



Loading…
Cancel
Save