This commit is contained in:
nemunaire 2018-07-10 00:33:00 +02:00
commit f25068075c
7 changed files with 113 additions and 22 deletions

View file

@ -72,12 +72,11 @@ func updateUser(user ckh.User, body []byte) (interface{}, error) {
return nil, errors.New("Username cannot be empty")
}
if len(uu.Password) == 0 {
return nil, errors.New("Password cannot be empty")
}
user.Username = uu.Username
user.ChangePassword(uu.Password)
if len(uu.Password) != 0 {
user.ChangePassword(uu.Password)
}
if _, err := user.Update(); err != nil {
return nil, err