From 6e3dba2cc559275b5287673957ec855e61b4163a Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 5 May 2014 19:58:13 -0400 Subject: Clean repo code --- routers/admin/user.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'routers/admin/user.go') 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 } -- cgit v1.2.3