Skip to content

Commit fedc9e9

Browse files
committed
Fix incorrect repository count on organization tab of dashboard
Fixes #17249
1 parent f0bd1e9 commit fedc9e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/org.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func GetUserOrgsList(user *User) ([]*MinimalOrg, error) {
456456
groupByStr := groupByCols.String()
457457
groupByStr = groupByStr[0 : len(groupByStr)-1]
458458

459-
sess.Select(groupByStr+", count(repo_id) as org_count").
459+
sess.Select(groupByStr+", count(distinct repo_id) as org_count").
460460
Table("user").
461461
Join("INNER", "team", "`team`.org_id = `user`.id").
462462
Join("INNER", "team_user", "`team`.id = `team_user`.team_id").

0 commit comments

Comments
 (0)