tokarchuk/v1.17
Unknwon 10 years ago
parent 57b3be4016
commit c4820f119d
  1. 2
      models/user.go
  2. 3
      routers/user/home.go

@ -418,7 +418,7 @@ func ChangeUserName(u *User, newUserName string) (err error) {
// UpdateUser updates user's information. // UpdateUser updates user's information.
func UpdateUser(u *User) error { 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 { if err != nil {
return err return err
} else if has { } else if has {

@ -105,6 +105,9 @@ func Dashboard(ctx *middleware.Context) {
// FIXME: cache results? // FIXME: cache results?
u, err := models.GetUserByName(act.ActUserName) u, err := models.GetUserByName(act.ActUserName)
if err != nil { if err != nil {
if err == models.ErrUserNotExist {
continue
}
ctx.Handle(500, "GetUserByName", err) ctx.Handle(500, "GetUserByName", err)
return return
} }

Loading…
Cancel
Save