diff options
Diffstat (limited to 'routers/web/repo/migrate.go')
-rw-r--r-- | routers/web/repo/migrate.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/routers/web/repo/migrate.go b/routers/web/repo/migrate.go index 1940d89628..5eba4690d0 100644 --- a/routers/web/repo/migrate.go +++ b/routers/web/repo/migrate.go @@ -11,6 +11,8 @@ import ( "strings" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/lfs" @@ -66,7 +68,7 @@ func Migrate(ctx *context.Context) { ctx.HTML(http.StatusOK, base.TplName("repo/migrate/"+serviceType.Name())) } -func handleMigrateError(ctx *context.Context, owner *models.User, err error, name string, tpl base.TplName, form *forms.MigrateRepoForm) { +func handleMigrateError(ctx *context.Context, owner *user_model.User, err error, name string, tpl base.TplName, form *forms.MigrateRepoForm) { if setting.Repository.DisableMigrations { ctx.Error(http.StatusForbidden, "MigrateError: the site administrator has disabled migrations") return @@ -94,12 +96,12 @@ func handleMigrateError(ctx *context.Context, owner *models.User, err error, nam default: ctx.RenderWithErr(ctx.Tr("form.repository_files_already_exist"), tpl, form) } - case models.IsErrNameReserved(err): + case db.IsErrNameReserved(err): ctx.Data["Err_RepoName"] = true - ctx.RenderWithErr(ctx.Tr("repo.form.name_reserved", err.(models.ErrNameReserved).Name), tpl, form) - case models.IsErrNamePatternNotAllowed(err): + ctx.RenderWithErr(ctx.Tr("repo.form.name_reserved", err.(db.ErrNameReserved).Name), tpl, form) + case db.IsErrNamePatternNotAllowed(err): ctx.Data["Err_RepoName"] = true - ctx.RenderWithErr(ctx.Tr("repo.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), tpl, form) + ctx.RenderWithErr(ctx.Tr("repo.form.name_pattern_not_allowed", err.(db.ErrNamePatternNotAllowed).Pattern), tpl, form) default: remoteAddr, _ := forms.ParseRemoteAddr(form.CloneAddr, form.AuthUsername, form.AuthPassword) err = util.NewStringURLSanitizedError(err, remoteAddr, true) |