aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/admin/user.go')
-rw-r--r--routers/api/v1/admin/user.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go
index 0a6dc5d456..36fea14f11 100644
--- a/routers/api/v1/admin/user.go
+++ b/routers/api/v1/admin/user.go
@@ -87,7 +87,11 @@ func EditUser(ctx *context.APIContext, form api.EditUserOption) {
if len(form.Password) > 0 {
u.Passwd = form.Password
- u.Salt = models.GetUserSalt()
+ var err error
+ if u.Salt, err = models.GetUserSalt(); err != nil {
+ ctx.Error(500, "UpdateUser", err)
+ return
+ }
u.EncodePasswd()
}