Browse Source

提交代码。

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

+ 4
- 4
models/ai_model_manage.go View File

@@ -7,6 +7,7 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
"xorm.io/builder"
"xorm.io/xorm"
)

type AiModelManage struct {
@@ -87,11 +88,10 @@ func DeleteModelById(id string) error {
}

func ModifyModelDescription(id string, description string) error {
sess := x.NewSession()
var sess *xorm.Session
sess = x.ID(id)
defer sess.Close()

re, err := sess.Update(&AiModelManage{
ID: id,
re, err := sess.Cols("description").Update(&AiModelManage{
Description: description,
})
if err != nil {


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

@@ -205,7 +205,7 @@ func ModifyModel(id string, description string) error {
if err == nil {
log.Info("modify success.")
} else {
log.Info("Failed to modify.id=" + id + " desc=" + description)
log.Info("Failed to modify.id=" + id + " desc=" + description + " error:" + err.Error())
}
return err
}


Loading…
Cancel
Save