From 4fda025cbd1b143c28b60a7e4ba050f150f18bba Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 30 Nov 2021 15:09:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=BA=E7=A9=BA=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=BF=94=E5=9B=9Eerror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_manage.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 4f07996fe..90d537031 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -110,6 +110,16 @@ func SaveModel(ctx *context.Context) { label := ctx.Query("Label") description := ctx.Query("Description") + if JobId == "" || VersionName == "" { + ctx.Error(500, fmt.Sprintf("JobId or VersionName is null.")) + return + } + + if name == "" || version == "" { + ctx.Error(500, fmt.Sprintf("name or version is null.")) + return + } + err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID) if err != nil {