1
0
Fork 0
forked from forgejo/forgejo

Add golangci (#6418)

This commit is contained in:
kolaente 2019-06-12 21:41:28 +02:00 committed by techknowlogick
parent 5832f8d90d
commit f9ec2f89f2
147 changed files with 1046 additions and 774 deletions

View file

@ -197,12 +197,20 @@ func WebHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
}
// GogsHooksNewPost response for creating webhook
func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
func GogsHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
newGenericWebhookPost(ctx, form, models.GOGS)
}
func newGenericWebhookPost(ctx *context.Context, form auth.NewWebhookForm, 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"] = "gogs"
ctx.Data["HookType"] = "gitea"
if kind == models.GOGS {
ctx.Data["HookType"] = "gogs"
}
orCtx, err := getOrgRepoCtx(ctx)
if err != nil {
@ -228,7 +236,7 @@ func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
Secret: form.Secret,
HookEvent: ParseHookEvent(form.WebhookForm),
IsActive: form.Active,
HookTaskType: models.GOGS,
HookTaskType: kind,
OrgID: orCtx.OrgID,
}
if err := w.UpdateEvent(); err != nil {