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 --- model/user.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'model/user.go') diff --git a/model/user.go b/model/user.go index 7cb3d0b70..1c390a121 100644 --- a/model/user.go +++ b/model/user.go @@ -67,15 +67,15 @@ type User struct { } type UserPatch struct { - Username *string `json:"username"` - Nickname *string `json:"nickname"` - FirstName *string `json:"first_name"` - LastName *string `json:"last_name"` - Position *string `json:"position"` - Email *string `json:"email"` - Props *StringMap `json:"props,omitempty"` - NotifyProps *StringMap `json:"notify_props,omitempty"` - Locale *string `json:"locale"` + Username *string `json:"username"` + Nickname *string `json:"nickname"` + FirstName *string `json:"first_name"` + LastName *string `json:"last_name"` + Position *string `json:"position"` + Email *string `json:"email"` + Props StringMap `json:"props,omitempty"` + NotifyProps StringMap `json:"notify_props,omitempty"` + Locale *string `json:"locale"` } // IsValid validates the user and returns an error if it isn't configured @@ -267,11 +267,11 @@ func (u *User) Patch(patch *UserPatch) { } if patch.Props != nil { - u.Props = *patch.Props + u.Props = patch.Props } if patch.NotifyProps != nil { - u.NotifyProps = *patch.NotifyProps + u.NotifyProps = patch.NotifyProps } if patch.Locale != nil { -- cgit v1.2.3-1-g7c22