From f27b797d08c95cfd8e77dfd0d167c61ea0aa26c6 Mon Sep 17 00:00:00 2001 From: liuzx Date: Mon, 17 Jan 2022 10:58:02 +0800 Subject: [PATCH] fix-1363 --- routers/repo/modelarts.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index e2174919e..ecabfd8d8 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -12,6 +12,7 @@ import ( "strconv" "strings" "time" + "unicode/utf8" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" @@ -1291,7 +1292,7 @@ func paramCheckCreateInferenceJob(form auth.CreateModelArtsInferenceJobForm) err return errors.New("分支名不能为空") } - if len(form.Description) > 255 { + if utf8.RuneCountInString(form.Description) > 255 { log.Error("the Description length(%d) must not more than 255", form.Description) return errors.New("描述字符不能超过255个字符") }