summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/release.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/release.go')
-rw-r--r--routers/web/repo/release.go20
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 {