summaryrefslogtreecommitdiffstats
path: root/api4/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/user.go')
-rw-r--r--api4/user.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/api4/user.go b/api4/user.go
index 8f8f08c75..9aa709db5 100644
--- a/api4/user.go
+++ b/api4/user.go
@@ -199,7 +199,8 @@ func getProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
if len(users) == 0 {
- c.Err = err
+ c.Err = model.NewAppError("getProfileImage", "api.user.get_profile_image.not_found.app_error", nil, "", http.StatusNotFound)
+ return
}
user := users[0]
@@ -589,8 +590,13 @@ func patchUser(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ ouser, err := c.App.GetUser(c.Params.UserId)
+ if err != nil {
+ c.SetInvalidParam("user_id")
+ return
+ }
+
if c.Session.IsOAuth && patch.Email != nil {
- ouser, err := c.App.GetUser(c.Params.UserId)
if err != nil {
c.Err = err
return
@@ -607,6 +613,7 @@ func patchUser(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = err
return
} else {
+ c.App.SetAutoResponderStatus(ruser, ouser.NotifyProps)
c.LogAudit("")
w.Write([]byte(ruser.ToJson()))
}