1
0
Fork 0
forked from forgejo/forgejo

Change general form binding to gogs form (#8334)

This commit is contained in:
Aam Surganda 2019-10-02 19:58:40 +07:00 committed by Lunny Xiao
parent 90ab3056eb
commit bcd4af483d
2 changed files with 9 additions and 12 deletions

View file

@ -198,20 +198,17 @@ func WebHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
}
// GogsHooksNewPost response for creating webhook
func GogsHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
newGenericWebhookPost(ctx, form, models.GOGS)
func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
newGogsWebhookPost(ctx, form, models.GOGS)
}
func newGenericWebhookPost(ctx *context.Context, form auth.NewWebhookForm, kind models.HookTaskType) {
// newGogsWebhookPost response for creating gogs hook
func newGogsWebhookPost(ctx *context.Context, form auth.NewGogshookForm, kind models.HookTaskType) {
ctx.Data["Title"] = ctx.Tr("repo.settings.add_webhook")
ctx.Data["PageIsSettingsHooks"] = true
ctx.Data["PageIsSettingsHooksNew"] = true
ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
ctx.Data["HookType"] = "gitea"
if kind == models.GOGS {
ctx.Data["HookType"] = "gogs"
}
ctx.Data["HookType"] = "gogs"
orCtx, err := getOrgRepoCtx(ctx)
if err != nil {