#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

@ -28,11 +28,12 @@ const (
)
func checkContextUser(ctx *middleware.Context, uid int64) *models.User {
if err := ctx.User.GetOrganizations(); err != nil {
ctx.Handle(500, "GetOrganizations", err)
orgs, err := models.GetOwnedOrgsByUserIDDesc(ctx.User.Id, "updated")
if err != nil {
ctx.Handle(500, "GetOwnedOrganizationsByUserIDDesc", err)
return nil
}
ctx.Data["Orgs"] = ctx.User.Orgs
ctx.Data["Orgs"] = orgs
// Not equal means current user is an organization.
if uid == ctx.User.Id || uid == 0 {