0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-15 22:41:44 +01:00

Fix UI issue

This commit is contained in:
Unknwon 2014-09-14 19:22:52 -04:00
parent 7027ac9308
commit efb68a0a96

View file

@ -176,6 +176,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
// Test repository root path. // Test repository root path.
if err := os.MkdirAll(form.RepoRootPath, os.ModePerm); err != nil { 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) ctx.RenderWithErr(ctx.Tr("install.invalid_repo_path", err), INSTALL, &form)
return return
} }
@ -187,12 +188,14 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
} }
// Does not check run user when the install lock is off. // Does not check run user when the install lock is off.
if form.RunUser != curUser { if form.RunUser != curUser {
ctx.Data["Err_RunUser"] = true
ctx.RenderWithErr(ctx.Tr("install.run_user_not_match", form.RunUser, curUser), INSTALL, &form) ctx.RenderWithErr(ctx.Tr("install.run_user_not_match", form.RunUser, curUser), INSTALL, &form)
return return
} }
// Check admin password. // Check admin password.
if form.AdminPasswd != form.ConfirmPasswd { if form.AdminPasswd != form.ConfirmPasswd {
ctx.Data["Err_AdminPasswd"] = true
ctx.RenderWithErr(ctx.Tr("form.password_not_match"), INSTALL, form) ctx.RenderWithErr(ctx.Tr("form.password_not_match"), INSTALL, form)
return return
} }
@ -240,6 +243,8 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
IsAdmin: true, IsActive: true}); err != nil { IsAdmin: true, IsActive: true}); err != nil {
if err != models.ErrUserAlreadyExist { if err != models.ErrUserAlreadyExist {
setting.InstallLock = false setting.InstallLock = false
ctx.Data["Err_AdminName"] = true
ctx.Data["Err_AdminEmail"] = true
ctx.RenderWithErr(ctx.Tr("install.invalid_admin_setting", err), INSTALL, &form) ctx.RenderWithErr(ctx.Tr("install.invalid_admin_setting", err), INSTALL, &form)
return return
} }