summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-07 13:58:23 -0400
committerUnknwon <u@gogs.io>2015-09-07 13:58:23 -0400
commit3d9b98fae4782a45edc3f53ad4561fe7e14a4377 (patch)
tree082f9394854f6549f003e283784b1b7e72126b7a /routers/repo/repo.go
parent36405d0faaf6e4ed5e0a0deb37aebf77a8c29ff0 (diff)
downloadgitea-3d9b98fae4782a45edc3f53ad4561fe7e14a4377.tar.gz
gitea-3d9b98fae4782a45edc3f53ad4561fe7e14a4377.zip
#1585 order owners list by last changed time
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index b9cc98a2dc..567b717a70 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -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 {