summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-11 15:11:13 -0500
committerUnknwon <u@gogs.io>2015-12-11 15:11:13 -0500
commit5d95ffe3eb216845606b7652160865eb1dd58111 (patch)
treefc0c062aa286d52acde495868c693ea13c690eda /models/user.go
parent98da7241a00a13d9fd46bc5d1cec1b2a3ac01534 (diff)
downloadgitea-5d95ffe3eb216845606b7652160865eb1dd58111.tar.gz
gitea-5d95ffe3eb216845606b7652160865eb1dd58111.zip
#2155 The owner has reached maximum creation limit of 0 repositories
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go
index cb9846f9fd..d1f06dea80 100644
--- a/models/user.go
+++ b/models/user.go
@@ -75,7 +75,7 @@ type User struct {
// Remember visibility choice for convenience, true for private
LastRepoVisibility bool
- // Maximum repository creation limit, 0 means use gloabl default
+ // Maximum repository creation limit, -1 means use gloabl default
MaxRepoCreation int `xorm:"NOT NULL DEFAULT -1"`
// Permissions.
@@ -138,7 +138,7 @@ func (u *User) RepoCreationNum() int {
func (u *User) CanCreateRepo() bool {
if u.MaxRepoCreation <= -1 {
- if setting.Repository.MaxCreationLimit == -1 {
+ if setting.Repository.MaxCreationLimit <= -1 {
return true
}
return u.NumRepos < setting.Repository.MaxCreationLimit
@@ -475,6 +475,7 @@ func CreateUser(u *User) (err error) {
u.Rands = GetUserSalt()
u.Salt = GetUserSalt()
u.EncodePasswd()
+ u.MaxRepoCreation = -1
sess := x.NewSession()
defer sess.Close()