aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r--routers/repo/setting.go8
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)