Skip to content

Commit 9ae7664

Browse files
aungerdaviian
authored andcommitted
Fix webhook type conflation. (#4285)
- Fix typo that caused Gogs hooks to be created as Gitea hooks. - Fix typo that caused Gogs hooks to be duplicated upon edit (though this bug was masked by the previous one). Signed-off-by: Russell Aunger <[email protected]>
1 parent ac110d1 commit 9ae7664

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

routers/repo/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
210210
Secret: form.Secret,
211211
HookEvent: ParseHookEvent(form.WebhookForm),
212212
IsActive: form.Active,
213-
HookTaskType: models.GITEA,
213+
HookTaskType: models.GOGS,
214214
OrgID: orCtx.OrgID,
215215
}
216216
if err := w.UpdateEvent(); err != nil {

routers/routes/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ func RegisterRoutes(m *macaron.Macaron) {
486486
m.Get("/:id", repo.WebHooksEdit)
487487
m.Post("/:id/test", repo.TestWebhook)
488488
m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
489-
m.Post("/gogs/:id", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksNewPost)
489+
m.Post("/gogs/:id", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksEditPost)
490490
m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost)
491491
m.Post("/discord/:id", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksEditPost)
492492
m.Post("/dingtalk/:id", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksEditPost)

0 commit comments

Comments
 (0)