summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-05-21 10:28:29 +0800
committerGitHub <noreply@github.com>2018-05-21 10:28:29 +0800
commit6bdc556b7f490be7360104b731ce817050cc1d80 (patch)
tree63887addb45b5b2be1e672580c984497fa9f4112 /routers
parentdc0ef38950ec8aca78f6e870fb83d1ca68074682 (diff)
downloadgitea-6bdc556b7f490be7360104b731ce817050cc1d80.tar.gz
gitea-6bdc556b7f490be7360104b731ce817050cc1d80.zip
Fix some webhooks bugs (#3981)
* fix some webhooks bugs * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix test * fix clearlabels * fix pullrequest webhook bug fix #3492 * update release webhook description * remove unused code * fix push webhook in pull request * small changes
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/release.go4
-rw-r--r--routers/repo/release.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go
index 70c1e0f264..c58e8aea53 100644
--- a/routers/api/v1/repo/release.go
+++ b/routers/api/v1/repo/release.go
@@ -171,7 +171,7 @@ func CreateRelease(ctx *context.APIContext, form api.CreateReleaseOption) {
rel.Repo = ctx.Repo.Repository
rel.Publisher = ctx.User
- if err = models.UpdateRelease(ctx.Repo.GitRepo, rel, nil); err != nil {
+ if err = models.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil); err != nil {
ctx.ServerError("UpdateRelease", err)
return
}
@@ -245,7 +245,7 @@ func EditRelease(ctx *context.APIContext, form api.EditReleaseOption) {
if form.IsPrerelease != nil {
rel.IsPrerelease = *form.IsPrerelease
}
- if err := models.UpdateRelease(ctx.Repo.GitRepo, rel, nil); err != nil {
+ if err := models.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil); err != nil {
ctx.Error(500, "UpdateRelease", err)
return
}
diff --git a/routers/repo/release.go b/routers/repo/release.go
index a54576b91b..bae87efdcd 100644
--- a/routers/repo/release.go
+++ b/routers/repo/release.go
@@ -197,7 +197,7 @@ func NewReleasePost(ctx *context.Context, form auth.NewReleaseForm) {
rel.PublisherID = ctx.User.ID
rel.IsTag = false
- if err = models.UpdateRelease(ctx.Repo.GitRepo, rel, attachmentUUIDs); err != nil {
+ if err = models.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, attachmentUUIDs); err != nil {
ctx.Data["Err_TagName"] = true
ctx.ServerError("UpdateRelease", err)
return
@@ -276,7 +276,7 @@ func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm) {
rel.Note = form.Content
rel.IsDraft = len(form.Draft) > 0
rel.IsPrerelease = form.Prerelease
- if err = models.UpdateRelease(ctx.Repo.GitRepo, rel, attachmentUUIDs); err != nil {
+ if err = models.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, attachmentUUIDs); err != nil {
ctx.ServerError("UpdateRelease", err)
return
}