Browse Source

Merge branch 'zouap' of https://git.openi.org.cn/OpenI/aiforge into zouap

pull/1036/head
zhoupzh 3 years ago
parent
commit
186b19d033
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      routers/repo/ai_model_manage.go

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

@@ -205,12 +205,19 @@ func deleteModelByID(ctx *context.Context, id string) error {
} }
err = models.DeleteModelById(id) err = models.DeleteModelById(id)
if err == nil { //find a model to change new if err == nil { //find a model to change new
aimodels := models.QueryModelByName(model.Name, model.RepoId)
if model.New == MODEL_LATEST { if model.New == MODEL_LATEST {
aimodels := models.QueryModelByName(model.Name, model.RepoId)
if len(aimodels) > 0 { if len(aimodels) > 0 {
//udpate status and version count //udpate status and version count
models.ModifyModelNewProperty(aimodels[0].ID, MODEL_LATEST, len(aimodels)) models.ModifyModelNewProperty(aimodels[0].ID, MODEL_LATEST, len(aimodels))
} }
} else {
for _, tmpModel := range aimodels {
if tmpModel.New == MODEL_LATEST {
models.ModifyModelNewProperty(tmpModel.ID, MODEL_LATEST, len(aimodels))
break
}
}
} }
} }
} }


Loading…
Cancel
Save