diff options
-rw-r--r-- | models/user.go | 2 | ||||
-rw-r--r-- | routers/user/home.go | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go index 7e6a6c824f..729f2c0c7e 100644 --- a/models/user.go +++ b/models/user.go @@ -418,7 +418,7 @@ func ChangeUserName(u *User, newUserName string) (err error) { // UpdateUser updates user's information. func UpdateUser(u *User) error { - has, err := x.Where("id != ?", u.Id).And("email = ?", u.Email).Get(new(User)) + has, err := x.Where("id!=?", u.Id).And("email=?", u.Email).Get(new(User)) if err != nil { return err } else if has { diff --git a/routers/user/home.go b/routers/user/home.go index f5f6ab9422..0de551715a 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -105,6 +105,9 @@ func Dashboard(ctx *middleware.Context) { // FIXME: cache results? u, err := models.GetUserByName(act.ActUserName) if err != nil { + if err == models.ErrUserNotExist { + continue + } ctx.Handle(500, "GetUserByName", err) return } |