|
|
|
@@ -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) |
|
|
|
|
|
|
|
|