#2155 The owner has reached maximum creation limit of 0 repositories
This commit is contained in:
		
							parent
							
								
									98da7241a0
								
							
						
					
					
						commit
						5d95ffe3eb
					
				
					 3 changed files with 5 additions and 4 deletions
				
			
		|  | @ -3,7 +3,7 @@ Gogs - Go Git Service [](https://gitter.im/gogits/gogs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | [](https://gitter.im/gogits/gogs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| 
 | 
 | ||||||
| ##### Current version: 0.7.42 Beta | ##### Current version: 0.7.42 Beta | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| # Docker for Gogs | # Docker for Gogs | ||||||
| 
 | 
 | ||||||
| Visit [Docker Hub](https://hub.docker.com/r/gogs/gogs/) or [QUAY](https://quay.io/repository/gogs/gogs) see all available tags. | Visit [Docker Hub](https://hub.docker.com/r/gogs/gogs/) or [Quay](https://quay.io/repository/gogs/gogs) see all available tags. | ||||||
| 
 | 
 | ||||||
| ## Usage | ## Usage | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -75,7 +75,7 @@ type User struct { | ||||||
| 
 | 
 | ||||||
| 	// Remember visibility choice for convenience, true for private
 | 	// Remember visibility choice for convenience, true for private
 | ||||||
| 	LastRepoVisibility bool | 	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"` | 	MaxRepoCreation int `xorm:"NOT NULL DEFAULT -1"` | ||||||
| 
 | 
 | ||||||
| 	// Permissions.
 | 	// Permissions.
 | ||||||
|  | @ -138,7 +138,7 @@ func (u *User) RepoCreationNum() int { | ||||||
| 
 | 
 | ||||||
| func (u *User) CanCreateRepo() bool { | func (u *User) CanCreateRepo() bool { | ||||||
| 	if u.MaxRepoCreation <= -1 { | 	if u.MaxRepoCreation <= -1 { | ||||||
| 		if setting.Repository.MaxCreationLimit == -1 { | 		if setting.Repository.MaxCreationLimit <= -1 { | ||||||
| 			return true | 			return true | ||||||
| 		} | 		} | ||||||
| 		return u.NumRepos < setting.Repository.MaxCreationLimit | 		return u.NumRepos < setting.Repository.MaxCreationLimit | ||||||
|  | @ -475,6 +475,7 @@ func CreateUser(u *User) (err error) { | ||||||
| 	u.Rands = GetUserSalt() | 	u.Rands = GetUserSalt() | ||||||
| 	u.Salt = GetUserSalt() | 	u.Salt = GetUserSalt() | ||||||
| 	u.EncodePasswd() | 	u.EncodePasswd() | ||||||
|  | 	u.MaxRepoCreation = -1 | ||||||
| 
 | 
 | ||||||
| 	sess := x.NewSession() | 	sess := x.NewSession() | ||||||
| 	defer sess.Close() | 	defer sess.Close() | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue