summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-09-25 19:03:53 -0400
committer无闻 <u@gogs.io>2015-09-25 19:03:53 -0400
commitee1256cf74f7f42f19fa22f77100aed78ad94987 (patch)
tree0c5bc5b1ed8215b169a9a66d7bf1457827721374 /models
parent0d5e57e4aeaaafcb9ddcaac095a4f187d2eaabb4 (diff)
parenta8fd615adc73bc5d37c753f14ec9738d1590e363 (diff)
downloadgitea-ee1256cf74f7f42f19fa22f77100aed78ad94987.tar.gz
gitea-ee1256cf74f7f42f19fa22f77100aed78ad94987.zip
Merge pull request #1691 from sapk/fix-admin-organization-new-ui
Fix admin organization new ui
Diffstat (limited to 'models')
-rw-r--r--models/org.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/models/org.go b/models/org.go
index b45dcafb21..5c3b0d12a1 100644
--- a/models/org.go
+++ b/models/org.go
@@ -184,11 +184,10 @@ func CountOrganizations() int64 {
return count
}
-// GetOrganizations returns given number of organizations with offset.
-func GetOrganizations(num, offset int) ([]*User, error) {
- orgs := make([]*User, 0, num)
- err := x.Limit(num, offset).Where("type=1").Asc("id").Find(&orgs)
- return orgs, err
+// Organizations returns number of organizations in given page.
+func Organizations(page, pageSize int) ([]*User, error) {
+ orgs := make([]*User, 0, pageSize)
+ return orgs, x.Limit(pageSize, (page-1)*pageSize).Where("type=1").Asc("id").Find(&orgs)
}
// DeleteOrganization completely and permanently deletes everything of organization.