summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-28 22:29:00 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-28 22:29:00 +0800
commit1aec1a2ddae3a3714d6a167d85fcc1c69413b660 (patch)
tree07fb6534ac71aea4edca41d39ececd7d81976b04 /models/org.go
parent81287ba022ae906f1f9eb5b1324567cd93771b4e (diff)
downloadgitea-1aec1a2ddae3a3714d6a167d85fcc1c69413b660.tar.gz
gitea-1aec1a2ddae3a3714d6a167d85fcc1c69413b660.zip
Finish new admin dashboard
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go6
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) {