From 90648ac5e9d40ee028a365329e7ea6e48f73c890 Mon Sep 17 00:00:00 2001 From: liuzx Date: Wed, 5 Jan 2022 11:47:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=9C=AA=E9=80=89=E4=BB=A3=E7=A0=81=E5=88=86?= =?UTF-8?q?=E6=94=AF=E6=97=B6=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/modelarts.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index a907aca01..3be58b077 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -1251,6 +1251,10 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error { log.Error("the WorkServerNumber(%d) must be in (1,25)", form.WorkServerNumber) return errors.New("计算节点数必须在1-25之间") } + if form.BranchName == nil || form.BranchName == "" { + log.Error("the branch must not be nil!", form.BranchName) + return errors.New("代码分支不能为空!") + } return nil } From 46c6fca60e0444529cc85da6edc996a78b7c92a1 Mon Sep 17 00:00:00 2001 From: liuzx Date: Wed, 5 Jan 2022 12:03:30 +0800 Subject: [PATCH 2/2] update --- routers/repo/modelarts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 3be58b077..19aeecc83 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -1251,8 +1251,8 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error { log.Error("the WorkServerNumber(%d) must be in (1,25)", form.WorkServerNumber) return errors.New("计算节点数必须在1-25之间") } - if form.BranchName == nil || form.BranchName == "" { - log.Error("the branch must not be nil!", form.BranchName) + if form.BranchName == "" { + log.Error("the branch must not be null!", form.BranchName) return errors.New("代码分支不能为空!") }