diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-05 19:58:13 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-05 19:58:13 -0400 |
commit | 6e3dba2cc559275b5287673957ec855e61b4163a (patch) | |
tree | e7188a38aad06b17663aa48b03b523ab24329c58 /routers/admin/user.go | |
parent | bbdfe2576966210cfffc830bfbe3731bcf653b3b (diff) |
Clean repo code
Diffstat (limited to 'routers/admin/user.go')
-rw-r--r-- | routers/admin/user.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/routers/admin/user.go b/routers/admin/user.go index f2e1b047..0d60ee9a 100644 --- a/routers/admin/user.go +++ b/routers/admin/user.go @@ -34,16 +34,15 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) { ctx.Data["Title"] = "New Account" ctx.Data["PageIsUsers"] = true + if ctx.HasError() { + ctx.HTML(200, "admin/users/new") + return + } + if form.Password != form.RetypePasswd { - ctx.Data["HasError"] = true ctx.Data["Err_Password"] = true ctx.Data["Err_RetypePasswd"] = true - ctx.Data["ErrorMsg"] = "Password and re-type password are not same" - auth.AssignForm(form, ctx.Data) - } - - if ctx.HasError() { - ctx.HTML(200, "admin/users/new") + ctx.RenderWithErr("Password and re-type password are not same.", "admin/users/new", &form) return } |