0
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-11 15:54:00 +01:00

Rename RepoCreationNum -> MaxCreationLimit ()

This commit is contained in:
Jonas Östanbäck 2017-05-24 02:27:08 +02:00 committed by Lunny Xiao
parent de39d09caa
commit 7b907ed348
2 changed files with 3 additions and 3 deletions
models
routers/repo

View file

@ -211,8 +211,8 @@ func (u *User) HasForkedRepo(repoID int64) bool {
return has
}
// RepoCreationNum returns the number of repositories created by the user
func (u *User) RepoCreationNum() int {
// MaxCreationLimit returns the number of repositories a user is allowed to create
func (u *User) MaxCreationLimit() int {
if u.MaxRepoCreation <= -1 {
return setting.Repository.MaxCreationLimit
}

View file

@ -93,7 +93,7 @@ func Create(ctx *context.Context) {
func handleCreateError(ctx *context.Context, owner *models.User, err error, name string, tpl base.TplName, form interface{}) {
switch {
case models.IsErrReachLimitOfRepo(err):
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.RepoCreationNum()), tpl, form)
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.MaxCreationLimit()), tpl, form)
case models.IsErrRepoAlreadyExist(err):
ctx.Data["Err_RepoName"] = true
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tpl, form)