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/release.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/release.go')
-rw-r--r-- | routers/web/repo/release.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index 4f58ac9546..5f894ae501 100644 --- a/routers/web/repo/release.go +++ b/routers/web/repo/release.go @@ -134,8 +134,8 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { // Temporary cache commits count of used branches to speed up. countCache := make(map[string]int64) cacheUsers := make(map[int64]*user_model.User) - if ctx.User != nil { - cacheUsers[ctx.User.ID] = ctx.User + if ctx.Doer != nil { + cacheUsers[ctx.Doer.ID] = ctx.Doer } var ok bool @@ -325,7 +325,7 @@ func NewReleasePost(ctx *context.Context) { } if len(form.TagOnly) > 0 { - if err = releaseservice.CreateNewTag(ctx, ctx.User, ctx.Repo.Repository, form.Target, form.TagName, msg); err != nil { + if err = releaseservice.CreateNewTag(ctx, ctx.Doer, ctx.Repo.Repository, form.Target, form.TagName, msg); err != nil { if models.IsErrTagAlreadyExists(err) { e := err.(models.ErrTagAlreadyExists) ctx.Flash.Error(ctx.Tr("repo.branch.tag_collision", e.TagName)) @@ -357,8 +357,8 @@ func NewReleasePost(ctx *context.Context) { rel = &models.Release{ RepoID: ctx.Repo.Repository.ID, Repo: ctx.Repo.Repository, - PublisherID: ctx.User.ID, - Publisher: ctx.User, + PublisherID: ctx.Doer.ID, + Publisher: ctx.Doer, Title: form.Title, TagName: form.TagName, Target: form.Target, @@ -394,16 +394,16 @@ func NewReleasePost(ctx *context.Context) { rel.Target = form.Target rel.IsDraft = len(form.Draft) > 0 rel.IsPrerelease = form.Prerelease - rel.PublisherID = ctx.User.ID + rel.PublisherID = ctx.Doer.ID rel.IsTag = false - if err = releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, attachmentUUIDs, nil, nil); err != nil { + if err = releaseservice.UpdateRelease(ctx.Doer, ctx.Repo.GitRepo, rel, attachmentUUIDs, nil, nil); err != nil { ctx.Data["Err_TagName"] = true ctx.ServerError("UpdateRelease", err) return } } - log.Trace("Release created: %s/%s:%s", ctx.User.LowerName, ctx.Repo.Repository.Name, form.TagName) + log.Trace("Release created: %s/%s:%s", ctx.Doer.LowerName, ctx.Repo.Repository.Name, form.TagName) ctx.Redirect(ctx.Repo.RepoLink + "/releases") } @@ -497,7 +497,7 @@ func EditReleasePost(ctx *context.Context) { rel.Note = form.Content rel.IsDraft = len(form.Draft) > 0 rel.IsPrerelease = form.Prerelease - if err = releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, + if err = releaseservice.UpdateRelease(ctx.Doer, ctx.Repo.GitRepo, rel, addAttachmentUUIDs, delAttachmentUUIDs, editAttachments); err != nil { ctx.ServerError("UpdateRelease", err) return @@ -516,7 +516,7 @@ func DeleteTag(ctx *context.Context) { } func deleteReleaseOrTag(ctx *context.Context, isDelTag bool) { - if err := releaseservice.DeleteReleaseByID(ctx, ctx.FormInt64("id"), ctx.User, isDelTag); err != nil { + if err := releaseservice.DeleteReleaseByID(ctx, ctx.FormInt64("id"), ctx.Doer, isDelTag); err != nil { ctx.Flash.Error("DeleteReleaseByID: " + err.Error()) } else { if isDelTag { |