diff options
Diffstat (limited to 'routers/api/v1/repo/release.go')
-rw-r--r-- | routers/api/v1/repo/release.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index 3cdd798151..7d23a38add 100644 --- a/routers/api/v1/repo/release.go +++ b/routers/api/v1/repo/release.go @@ -191,8 +191,8 @@ func CreateRelease(ctx *context.APIContext) { } rel = &models.Release{ RepoID: ctx.Repo.Repository.ID, - PublisherID: ctx.User.ID, - Publisher: ctx.User, + PublisherID: ctx.Doer.ID, + Publisher: ctx.Doer, TagName: form.TagName, Target: form.Target, Title: form.Title, @@ -220,12 +220,12 @@ func CreateRelease(ctx *context.APIContext) { rel.Note = form.Note rel.IsDraft = form.IsDraft rel.IsPrerelease = form.IsPrerelease - rel.PublisherID = ctx.User.ID + rel.PublisherID = ctx.Doer.ID rel.IsTag = false rel.Repo = ctx.Repo.Repository - rel.Publisher = ctx.User + rel.Publisher = ctx.Doer - if err = releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil { + if err = releaseservice.UpdateRelease(ctx.Doer, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil { ctx.Error(http.StatusInternalServerError, "UpdateRelease", err) return } @@ -300,7 +300,7 @@ func EditRelease(ctx *context.APIContext) { if form.IsPrerelease != nil { rel.IsPrerelease = *form.IsPrerelease } - if err := releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil { + if err := releaseservice.UpdateRelease(ctx.Doer, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil { ctx.Error(http.StatusInternalServerError, "UpdateRelease", err) return } @@ -356,7 +356,7 @@ func DeleteRelease(ctx *context.APIContext) { ctx.NotFound() return } - if err := releaseservice.DeleteReleaseByID(ctx, id, ctx.User, false); err != nil { + if err := releaseservice.DeleteReleaseByID(ctx, id, ctx.Doer, false); err != nil { ctx.Error(http.StatusInternalServerError, "DeleteReleaseByID", err) return } |