forked from forgejo/forgejo
#1575 Limit repo creation
This commit is contained in:
parent
c6083c335e
commit
2a0bb1fa90
15 changed files with 73 additions and 14 deletions
|
@ -107,6 +107,19 @@ func (err ErrUserHasOrgs) Error() string {
|
|||
return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
|
||||
}
|
||||
|
||||
type ErrReachLimitOfRepo struct {
|
||||
Limit int
|
||||
}
|
||||
|
||||
func IsErrReachLimitOfRepo(err error) bool {
|
||||
_, ok := err.(ErrReachLimitOfRepo)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrReachLimitOfRepo) Error() string {
|
||||
return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
|
||||
}
|
||||
|
||||
// __ __.__ __ .__
|
||||
// / \ / \__| | _|__|
|
||||
// \ \/\/ / | |/ / |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue