From 80fd25524e13dedbdc3527b32d008de152213a89 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 22 Mar 2022 08:03:22 +0100 Subject: Renamed ctx.User to ctx.Doer. (#19161) Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang --- routers/web/repo/projects.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'routers/web/repo/projects.go') diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 3836a00d04..9df2520a52 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -143,7 +143,7 @@ func NewProjectPost(ctx *context.Context) { RepoID: ctx.Repo.Repository.ID, Title: form.Title, Description: form.Content, - CreatorID: ctx.User.ID, + CreatorID: ctx.Doer.ID, BoardType: form.BoardType, Type: models.ProjectTypeRepository, }); err != nil { @@ -354,7 +354,7 @@ func UpdateIssueProject(ctx *context.Context) { continue } - if err := models.ChangeProjectAssign(issue, ctx.User, projectID); err != nil { + if err := models.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil { ctx.ServerError("ChangeProjectAssign", err) return } @@ -367,7 +367,7 @@ func UpdateIssueProject(ctx *context.Context) { // DeleteProjectBoard allows for the deletion of a project board func DeleteProjectBoard(ctx *context.Context) { - if ctx.User == nil { + if ctx.Doer == nil { ctx.JSON(http.StatusForbidden, map[string]string{ "message": "Only signed in users are allowed to perform this action.", }) @@ -444,7 +444,7 @@ func AddBoardToProjectPost(ctx *context.Context) { ProjectID: project.ID, Title: form.Title, Color: form.Color, - CreatorID: ctx.User.ID, + CreatorID: ctx.Doer.ID, }); err != nil { ctx.ServerError("NewProjectBoard", err) return @@ -456,7 +456,7 @@ func AddBoardToProjectPost(ctx *context.Context) { } func checkProjectBoardChangePermissions(ctx *context.Context) (*models.Project, *models.ProjectBoard) { - if ctx.User == nil { + if ctx.Doer == nil { ctx.JSON(http.StatusForbidden, map[string]string{ "message": "Only signed in users are allowed to perform this action.", }) @@ -548,7 +548,7 @@ func SetDefaultProjectBoard(ctx *context.Context) { // MoveIssues moves or keeps issues in a column and sorts them inside that column func MoveIssues(ctx *context.Context) { - if ctx.User == nil { + if ctx.Doer == nil { ctx.JSON(http.StatusForbidden, map[string]string{ "message": "Only signed in users are allowed to perform this action.", }) -- cgit v1.2.3