diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-08-28 22:29:00 +0800 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-08-28 22:29:00 +0800 |
commit | 1aec1a2ddae3a3714d6a167d85fcc1c69413b660 (patch) | |
tree | 07fb6534ac71aea4edca41d39ececd7d81976b04 /models/org.go | |
parent | 81287ba022ae906f1f9eb5b1324567cd93771b4e (diff) | |
download | gitea-1aec1a2ddae3a3714d6a167d85fcc1c69413b660.tar.gz gitea-1aec1a2ddae3a3714d6a167d85fcc1c69413b660.zip |
Finish new admin dashboard
Diffstat (limited to 'models/org.go')
-rw-r--r-- | models/org.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/org.go b/models/org.go index 1c74c290e9..18ed68e6f4 100644 --- a/models/org.go +++ b/models/org.go @@ -159,6 +159,12 @@ func CreateOrganization(org, owner *User) (*User, error) { return org, sess.Commit() } +// CountOrganizations returns number of organizations. +func CountOrganizations() int64 { + count, _ := x.Where("type=1").Count(new(User)) + return count +} + // TODO: need some kind of mechanism to record failure. // DeleteOrganization completely and permanently deletes everything of organization. func DeleteOrganization(org *User) (err error) { |