MCPcopy Create free account
hub / github.com/gogs/gogs / GetOrganizationCount

Method GetOrganizationCount

internal/database/users.go:1442–1444  ·  view source on GitHub ↗

GetOrganizationCount returns the count of organization membership that the user has. TODO(unknwon): This is also used in templates, which should be fixed by having a dedicated type `template.User`.

()

Source from the content-addressed store, hash-verified

1440// TODO(unknwon): This is also used in templates, which should be fixed by
1441// having a dedicated type `template.User`.
1442func (u *User) GetOrganizationCount() (int64, error) {
1443 return Handle.Organizations().CountByUser(context.TODO(), u.ID)
1444}
1445
1446// ShortName truncates and returns the username at most in given length.
1447//

Callers

nothing calls this directly

Implementers 1

mailerUserinternal/database/issue_mail.go

Calls 2

CountByUserMethod · 0.80
OrganizationsMethod · 0.80

Tested by

no test coverage detected