From 378889300581ef74695624a47437e6c328e28c72 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 13 Jan 2022 16:44:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=82?= 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 11b776e38..e5441b904 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -146,7 +146,8 @@ func SaveModel(ctx *context.Context) { if !trainTaskCreate { if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { - ctx.ServerError("No right.", errors.New(ctx.Tr("repo.model_noright"))) + ctx.NotFound(ctx.Req.URL.RequestURI(), nil) + //ctx.ServerError("No right.", errors.New(ctx.Tr("repo.model_noright"))) return } } @@ -624,7 +625,8 @@ func ModifyModelInfo(ctx *context.Context) { return } if !isOper(ctx, task.UserId) { - ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) + ctx.NotFound(ctx.Req.URL.RequestURI(), nil) + //ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) return } From 06c5210780d3c45154606bb21386cde8bb95cb7b Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 13 Jan 2022 16:49:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=82?= 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index e5441b904..7fe6d33cd 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -271,7 +271,7 @@ func DownloadMultiModelFile(ctx *context.Context) { return } if !isOper(ctx, task.UserId) { - ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) + ctx.NotFound(ctx.Req.URL.RequestURI(), nil) return } @@ -553,7 +553,7 @@ func isOper(ctx *context.Context, modelUserId int64) bool { func ShowModelPageInfo(ctx *context.Context) { log.Info("ShowModelInfo start.") if !isQueryRight(ctx) { - ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) + ctx.NotFound(ctx.Req.URL.RequestURI(), nil) return } page := ctx.QueryInt("page")