#1585 order owners list by last changed time

This commit is contained in:
Unknwon 2015-09-07 13:58:23 -04:00
parent 36405d0faa
commit 3d9b98fae4
3 changed files with 32 additions and 3 deletions

View file

@ -61,6 +61,7 @@ type User struct {
LoginSource int64 `xorm:"NOT NULL DEFAULT 0"`
LoginName string
Type UserType
OwnedOrgs []*User `xorm:"-"`
Orgs []*User `xorm:"-"`
Repos []*Repository `xorm:"-"`
Location string
@ -307,6 +308,12 @@ func (u *User) GetRepositories() (err error) {
return err
}
// GetOwnedOrganizations returns all organizations that user owns.
func (u *User) GetOwnedOrganizations() (err error) {
u.OwnedOrgs, err = GetOwnedOrgsByUserID(u.Id)
return err
}
// GetOrganizations returns all organizations that user belongs to.
func (u *User) GetOrganizations() error {
ous, err := GetOrgUsersByUserId(u.Id)