Просмотр исходного кода

Rename RepoCreationNum -> MaxCreationLimit (#1766)

tags/v1.2.0-rc1
Jonas Östanbäck 7 лет назад
Родитель
Сommit
7b907ed348
2 измененных файлов: 3 добавлений и 3 удалений
  1. 2
    2
      models/user.go
  2. 1
    1
      routers/repo/repo.go

+ 2
- 2
models/user.go Просмотреть файл

@@ -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
}

+ 1
- 1
routers/repo/repo.go Просмотреть файл

@@ -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)

Загрузка…
Отмена
Сохранить