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/web/repo/projects.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/web/repo/projects.go')
-rw-r--r-- | routers/web/repo/projects.go | 12 |
1 files changed, 6 insertions, 6 deletions
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.", }) |