aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/user.go')
-rw-r--r--routers/user/user.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/routers/user/user.go b/routers/user/user.go
index be2c4d3839..ea6922591e 100644
--- a/routers/user/user.go
+++ b/routers/user/user.go
@@ -139,11 +139,13 @@ func SignUp(ctx *middleware.Context, form auth.RegisterForm) {
var err error
if u, err = models.RegisterUser(u); err != nil {
- switch err.Error() {
- case models.ErrUserAlreadyExist.Error():
+ switch err {
+ case models.ErrUserAlreadyExist:
ctx.RenderWithErr("Username has been already taken", "user/signup", &form)
- case models.ErrEmailAlreadyUsed.Error():
+ case models.ErrEmailAlreadyUsed:
ctx.RenderWithErr("E-mail address has been already used", "user/signup", &form)
+ case models.ErrUserNameIllegal:
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "user/signup", &form)
default:
ctx.Handle(200, "user.SignUp", err)
}