Browse Source

work on #754

for-closed-social
Unknwon 10 years ago
parent
commit
c4820f119d
2 changed files with 4 additions and 1 deletions
  1. +1
    -1
      models/user.go
  2. +3
    -0
      routers/user/home.go

+ 1
- 1
models/user.go View File

@ -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 {

+ 3
- 0
routers/user/home.go View File

@ -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
}

Loading…
Cancel
Save