From 251bda5903ec2948d21baf9f94f0392da605c624 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Sat, 2 Apr 2022 16:31:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 74ba7957c..f08711b76 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -465,15 +465,15 @@ func CloudBrainImageEdit(ctx *context.Context) { if err != nil { log.Error("GetImageByID failed:%v", err.Error()) ctx.NotFound(ctx.Req.URL.RequestURI(), nil) - - image, err := models.GetImageByID(id) - if err != nil { - log.Error("GetImageByID failed:%v", err.Error()) - ctx.NotFound(ctx.Req.URL.RequestURI(), nil) - } - ctx.Data["Image"] = image - ctx.HTML(http.StatusOK, tplCloudBrainImageEdit) } + image, err := models.GetImageByID(id) + if err != nil { + log.Error("GetImageByID failed:%v", err.Error()) + ctx.NotFound(ctx.Req.URL.RequestURI(), nil) + } + ctx.Data["Image"] = image + ctx.HTML(http.StatusOK, tplCloudBrainImageEdit) + } func CloudBrainImageEditPost(ctx *context.Context, form auth.EditImageCloudBrainForm) { From 52ab9194b4084741514f937930b19021d169d447 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Sat, 2 Apr 2022 16:35:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index f08711b76..4f484c3f2 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -815,7 +815,7 @@ func CloudBrainShowModels(ctx *context.Context) { func GetPublicImages(ctx *context.Context) { opts := models.SearchImageOptions{ - IncludePrivateOnly: true, + IncludePublicOnly: true, UID: -1, Keyword: ctx.Query("q"), Topics: ctx.Query("topic"),