diff options
author | Unknwon <u@gogs.io> | 2015-02-24 00:27:22 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-02-24 00:27:22 -0500 |
commit | 8896c82d34ec5d86af1eeafb8c55a06f81bd3af1 (patch) | |
tree | 6b71dc1f8b609a957769dd8d5d0af485205fba2b /routers | |
parent | f92bfabf864bf7fae19777a537986fffcef0c873 (diff) | |
download | gitea-8896c82d34ec5d86af1eeafb8c55a06f81bd3af1.tar.gz gitea-8896c82d34ec5d86af1eeafb8c55a06f81bd3af1.zip |
models: fix issue with transfer repository
README: fix typo
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/setting.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index e2b8968375..5cd39ada2c 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -53,15 +53,11 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { newRepoName := form.RepoName // Check if repository name has been changed. if ctx.Repo.Repository.Name != newRepoName { - isExist, err := models.IsRepositoryExist(ctx.Repo.Owner, newRepoName) - if err != nil { - ctx.Handle(500, "IsRepositoryExist", err) - return - } else if isExist { + if models.IsRepositoryExist(ctx.Repo.Owner, newRepoName) { ctx.Data["Err_RepoName"] = true ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), SETTINGS_OPTIONS, nil) return - } else if err = models.ChangeRepositoryName(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName); err != nil { + } else if err := models.ChangeRepositoryName(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName); err != nil { if err == models.ErrRepoNameIllegal { ctx.Data["Err_RepoName"] = true ctx.RenderWithErr(ctx.Tr("form.illegal_repo_name"), SETTINGS_OPTIONS, nil) |