Don't sanitize returned user when updating a user (#6095)

* Don't sanitize returned user when updating a user

* Use user model function for clearing private data
Этот коммит содержится в:
Joram Wilander
2017-04-19 15:38:35 -04:00
коммит произвёл Christopher Speller
родитель bc906abd66
Коммит 0b919a324a
4 изменённых файлов: 36 добавлений и 54 удалений

Просмотреть файл

@@ -739,6 +739,8 @@ func TestPatchUser(t *testing.T) {
patch.LastName = new(string)
*patch.LastName = "Wilander"
patch.Position = new(string)
patch.NotifyProps = model.StringMap{}
patch.NotifyProps["comment"] = "somethingrandom"
ruser, resp := Client.PatchUser(user.Id, patch)
CheckNoError(t, resp)
@@ -759,6 +761,9 @@ func TestPatchUser(t *testing.T) {
if ruser.Username != user.Username {
t.Fatal("Username should not have updated")
}
if ruser.NotifyProps["comment"] != "somethingrandom" {
t.Fatal("NotifyProps did not update properly")
}
_, resp = Client.PatchUser("junk", patch)
CheckBadRequestStatus(t, resp)