aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-11 16:11:33 -0500
committerUnknwon <u@gogs.io>2016-03-11 16:11:33 -0500
commit263304b6b778a3c9e55128da050df8e31e291fab (patch)
tree6dd2d5006b13e4dbf24c9191531d0a33f74f04ab /models/repo.go
parent73e98c91c3eee6c506f03e1323795b2421d3a4d8 (diff)
downloadgitea-263304b6b778a3c9e55128da050df8e31e291fab.tar.gz
gitea-263304b6b778a3c9e55128da050df8e31e291fab.zip
#13 fix postgres aggregate
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/repo.go b/models/repo.go
index 4c19037624..abe67a6d8e 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1527,9 +1527,6 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int
if !opts.Private {
sess.And("is_private=?", false)
}
- if len(opts.OrderBy) > 0 {
- sess.OrderBy(opts.OrderBy)
- }
var countSess xorm.Session
countSess = *sess
@@ -1538,6 +1535,9 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int
return nil, 0, fmt.Errorf("Count: %v", err)
}
+ if len(opts.OrderBy) > 0 {
+ sess.OrderBy(opts.OrderBy)
+ }
return repos, count, sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&repos)
}