diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-08-24 21:09:05 +0800 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-08-24 21:09:05 +0800 |
commit | 21a1b8e5a35c61bff30145ac3194ea893a9c6b68 (patch) | |
tree | b218aedd0d64252d95725f12338a1ced1f155ba9 /models/user.go | |
parent | e325c8499a102ba8a6a84236c02dd7951f46cec5 (diff) | |
download | gitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.tar.gz gitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.zip |
Finish new edit team page, add member to team
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go index 757c290b9c..e8db1ad157 100644 --- a/models/user.go +++ b/models/user.go @@ -54,7 +54,8 @@ type User struct { LoginSource int64 `xorm:"not null default 0"` LoginName string Type UserType - Orgs []*User `xorm:"-"` + Orgs []*User `xorm:"-"` + Repos []*Repository `xorm:"-"` NumFollowers int NumFollowings int NumStars int @@ -143,6 +144,12 @@ func (u *User) GetOrganizationCount() (int64, error) { return x.Where("uid=?", u.Id).Count(new(OrgUser)) } +// GetRepositories returns all repositories that user owns, including private repositories. +func (u *User) GetRepositories() (err error) { + u.Repos, err = GetRepositories(u.Id, true) + return err +} + // GetOrganizations returns all organizations that user belongs to. func (u *User) GetOrganizations() error { ous, err := GetOrgUsersByUserId(u.Id) |