Skip to content

Commit

Permalink
Fix UI issue
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Sep 14, 2014
1 parent 7027ac9 commit efb68a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions routers/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {

// Test repository root path.
if err := os.MkdirAll(form.RepoRootPath, os.ModePerm); err != nil {
ctx.Data["Err_RepoRootPath"] = true
ctx.RenderWithErr(ctx.Tr("install.invalid_repo_path", err), INSTALL, &form)
return
}
Expand All @@ -187,12 +188,14 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
}
// Does not check run user when the install lock is off.
if form.RunUser != curUser {
ctx.Data["Err_RunUser"] = true
ctx.RenderWithErr(ctx.Tr("install.run_user_not_match", form.RunUser, curUser), INSTALL, &form)
return
}

// Check admin password.
if form.AdminPasswd != form.ConfirmPasswd {
ctx.Data["Err_AdminPasswd"] = true
ctx.RenderWithErr(ctx.Tr("form.password_not_match"), INSTALL, form)
return
}
Expand Down Expand Up @@ -240,6 +243,8 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
IsAdmin: true, IsActive: true}); err != nil {
if err != models.ErrUserAlreadyExist {
setting.InstallLock = false
ctx.Data["Err_AdminName"] = true
ctx.Data["Err_AdminEmail"] = true
ctx.RenderWithErr(ctx.Tr("install.invalid_admin_setting", err), INSTALL, &form)
return
}
Expand Down

0 comments on commit efb68a0

Please sign in to comment.