summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-10-08 11:33:16 +0200
committerGitHub <noreply@github.com>2021-10-08 17:33:16 +0800
commit1c3ae6d05e6099d30f61a9057d8e12cdfc80975d (patch)
tree212e0e0895f68d5913935c78272c93a6121d7ed0 /models
parenta1e57ebe6b1cd42a18d34bf576f101f6889b0953 (diff)
downloadgitea-1c3ae6d05e6099d30f61a9057d8e12cdfc80975d.tar.gz
gitea-1c3ae6d05e6099d30f61a9057d8e12cdfc80975d.zip
Fix incorrect repository count on organization tab of dashboard (#17266)
Fixes #17249
Diffstat (limited to 'models')
-rw-r--r--models/org.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/org.go b/models/org.go
index 4a891a83f4..f670ad2ae1 100644
--- a/models/org.go
+++ b/models/org.go
@@ -455,7 +455,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").