Skip to content

Commit 7b907ed

Browse files
cez81lunny
authored andcommitted
Rename RepoCreationNum -> MaxCreationLimit (#1766)
1 parent de39d09 commit 7b907ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

models/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ func (u *User) HasForkedRepo(repoID int64) bool {
211211
return has
212212
}
213213

214-
// RepoCreationNum returns the number of repositories created by the user
215-
func (u *User) RepoCreationNum() int {
214+
// MaxCreationLimit returns the number of repositories a user is allowed to create
215+
func (u *User) MaxCreationLimit() int {
216216
if u.MaxRepoCreation <= -1 {
217217
return setting.Repository.MaxCreationLimit
218218
}

routers/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func Create(ctx *context.Context) {
9393
func handleCreateError(ctx *context.Context, owner *models.User, err error, name string, tpl base.TplName, form interface{}) {
9494
switch {
9595
case models.IsErrReachLimitOfRepo(err):
96-
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.RepoCreationNum()), tpl, form)
96+
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.MaxCreationLimit()), tpl, form)
9797
case models.IsErrRepoAlreadyExist(err):
9898
ctx.Data["Err_RepoName"] = true
9999
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tpl, form)

0 commit comments

Comments
 (0)