From 0b919a324adeebd2f4ef6f250188752176ffe63f Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 19 Apr 2017 15:38:35 -0400 Subject: 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 --- api4/user_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api4') diff --git a/api4/user_test.go b/api4/user_test.go index d044cee9b..9a360c7e4 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -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) -- cgit v1.2.3-1-g7c22