diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-03-22 08:03:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 15:03:22 +0800 |
commit | 80fd25524e13dedbdc3527b32d008de152213a89 (patch) | |
tree | 63b2bfe4ffaf1dce12080cabdc2e845c8731a673 /routers/api/v1/admin/user.go | |
parent | 5495ba7660979973ba19e304786135da474e0e64 (diff) | |
download | gitea-80fd25524e13dedbdc3527b32d008de152213a89.tar.gz gitea-80fd25524e13dedbdc3527b32d008de152213a89.zip |
Renamed ctx.User to ctx.Doer. (#19161)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/api/v1/admin/user.go')
-rw-r--r-- | routers/api/v1/admin/user.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 1d3854df9b..677950664d 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -128,13 +128,13 @@ func CreateUser(ctx *context.APIContext) { } return } - log.Trace("Account created by admin (%s): %s", ctx.User.Name, u.Name) + log.Trace("Account created by admin (%s): %s", ctx.Doer.Name, u.Name) // Send email notification. if form.SendNotify { mailer.SendRegisterNotifyMail(u) } - ctx.JSON(http.StatusCreated, convert.ToUser(u, ctx.User)) + ctx.JSON(http.StatusCreated, convert.ToUser(u, ctx.Doer)) } // EditUser api for modifying a user's information @@ -275,9 +275,9 @@ func EditUser(ctx *context.APIContext) { } return } - log.Trace("Account profile updated by admin (%s): %s", ctx.User.Name, u.Name) + log.Trace("Account profile updated by admin (%s): %s", ctx.Doer.Name, u.Name) - ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.User)) + ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.Doer)) } // DeleteUser api for deleting a user @@ -320,7 +320,7 @@ func DeleteUser(ctx *context.APIContext) { } return } - log.Trace("Account deleted by admin(%s): %s", ctx.User.Name, u.Name) + log.Trace("Account deleted by admin(%s): %s", ctx.Doer.Name, u.Name) ctx.Status(http.StatusNoContent) } @@ -401,7 +401,7 @@ func DeleteUserPublicKey(ctx *context.APIContext) { } return } - log.Trace("Key deleted by admin(%s): %s", ctx.User.Name, u.Name) + log.Trace("Key deleted by admin(%s): %s", ctx.Doer.Name, u.Name) ctx.Status(http.StatusNoContent) } @@ -431,7 +431,7 @@ func GetAllUsers(ctx *context.APIContext) { listOptions := utils.GetListOptions(ctx) users, maxResults, err := user_model.SearchUsers(&user_model.SearchUserOptions{ - Actor: ctx.User, + Actor: ctx.Doer, Type: user_model.UserTypeIndividual, OrderBy: db.SearchOrderByAlphabetically, ListOptions: listOptions, @@ -443,7 +443,7 @@ func GetAllUsers(ctx *context.APIContext) { results := make([]*api.User, len(users)) for i := range users { - results[i] = convert.ToUser(users[i], ctx.User) + results[i] = convert.ToUser(users[i], ctx.Doer) } ctx.SetLinkHeader(int(maxResults), listOptions.PageSize) |