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
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
bc906abd66
Коммит
0b919a324a
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user