summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
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) {