summaryrefslogtreecommitdiffstats
path: root/model/user.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-19 15:38:35 -0400
committerChristopher Speller <crspeller@gmail.com>2017-04-19 15:38:35 -0400
commit0b919a324adeebd2f4ef6f250188752176ffe63f (patch)
tree367a07677e658518506064d7cb4107516e5e9711 /model/user.go
parentbc906abd6672efbe9b755a4edd5dbc5f7a39761f (diff)
downloadchat-0b919a324adeebd2f4ef6f250188752176ffe63f.tar.gz
chat-0b919a324adeebd2f4ef6f250188752176ffe63f.tar.bz2
chat-0b919a324adeebd2f4ef6f250188752176ffe63f.zip
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
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go22
1 files changed, 11 insertions, 11 deletions
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 {