From 4d2b7b4642e9e5c8cf25ac498b5cdb9f85261028 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 12 Oct 2021 10:30:59 +0800 Subject: [PATCH 1/2] fix issue #427 --- templates/explore/dataset_search.tmpl | 4 ++-- templates/explore/search.tmpl | 4 ++-- templates/repo/datasets/index.tmpl | 4 ++-- templates/repo/issue/search.tmpl | 2 +- templates/user/dashboard/issues.tmpl | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/explore/dataset_search.tmpl b/templates/explore/dataset_search.tmpl index 6c973026a..aad8f5083 100644 --- a/templates/explore/dataset_search.tmpl +++ b/templates/explore/dataset_search.tmpl @@ -1,12 +1,12 @@
-
+
- +
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl index 11e89d50a..4353f7302 100644 --- a/templates/explore/search.tmpl +++ b/templates/explore/search.tmpl @@ -1,11 +1,11 @@
-
+
- +
diff --git a/templates/repo/datasets/index.tmpl b/templates/repo/datasets/index.tmpl index b92d5a1ae..167b1ef44 100755 --- a/templates/repo/datasets/index.tmpl +++ b/templates/repo/datasets/index.tmpl @@ -37,7 +37,7 @@
{{if .Permission.CanWrite $.UnitTypeDatasets}} @@ -66,7 +66,7 @@
{{.i18n.Tr "cancel"}} - +
diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl index 632270da8..147f06485 100644 --- a/templates/repo/issue/search.tmpl +++ b/templates/repo/issue/search.tmpl @@ -7,7 +7,7 @@
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index ebe552f50..6334ea3dc 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -74,7 +74,7 @@
From f1cd4aa8e46095588ed47bdc2d2ddb0ccd3c0b52 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 12 Oct 2021 11:11:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=E9=87=8D=E5=A4=8D=E7=9A=84=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=89=80=E6=9C=89=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 10 ---------- routers/repo/user_data_analysis.go | 6 +++++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 9da0694a5..a00aef0c8 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -344,13 +344,3 @@ func subMonth(t1, t2 time.Time) (month int) { month = yearInterval*12 + monthInterval return month } - -func QueryAllRepo() []*Repository { - sess := x.NewSession() - defer sess.Close() - sess.Select("*").Table("repository") - repositoryList := make([]*Repository, 0) - sess.Find(&repositoryList) - - return repositoryList -} diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 13850af7a..2d9c03e1d 100644 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -18,7 +18,11 @@ func TimeingCountData() { yesterday := currentTimeNow.AddDate(0, 0, -1) - repoList := models.QueryAllRepo() + repoList, err := models.GetAllRepositories() + if err != nil { + log.Error("query repo error.") + return + } log.Info("start to query wiki data") for _, repoRecord := range repoList { wikiPath := models.WikiPath(repoRecord.OwnerName, repoRecord.Name)