Skip to content

Commit b614715

Browse files
authored
Fix incorrect repository count on organization tab of dashboard (#17256)
Fixes #17249
1 parent cd0928f commit b614715

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/org.go

+1-1
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)