aboutsummaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-10-08 08:49:20 +0200
committerGitHub <noreply@github.com>2021-10-08 08:49:20 +0200
commitb6147152f8a60db3d1b4c134280afa3e9f77e3bc (patch)
tree8e7b185825eebdc85bb0248447c2d93a1c853a57 /models/org.go
parentcd0928f0e8cdfada471507de4e2921f92d716cd6 (diff)
downloadgitea-b6147152f8a60db3d1b4c134280afa3e9f77e3bc.tar.gz
gitea-b6147152f8a60db3d1b4c134280afa3e9f77e3bc.zip
Fix incorrect repository count on organization tab of dashboard (#17256)
Fixes #17249
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/org.go b/models/org.go
index 94939d2c74..eadd1e157c 100644
--- a/models/org.go
+++ b/models/org.go
@@ -456,7 +456,7 @@ func GetUserOrgsList(user *User) ([]*MinimalOrg, error) {
groupByStr := groupByCols.String()
groupByStr = groupByStr[0 : len(groupByStr)-1]
- sess.Select(groupByStr+", count(repo_id) as org_count").
+ sess.Select(groupByStr+", count(distinct repo_id) as org_count").
Table("user").
Join("INNER", "team", "`team`.org_id = `user`.id").
Join("INNER", "team_user", "`team`.id = `team_user`.team_id").