diff --git a/models/user.go b/models/user.go index 7e6a6c82..729f2c0c 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 f5f6ab94..0de55171 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 }