diff options
Diffstat (limited to 'models/repo_generate.go')
-rw-r--r-- | models/repo_generate.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/repo_generate.go b/models/repo_generate.go index 650da711a3..cef5fa7928 100644 --- a/models/repo_generate.go +++ b/models/repo_generate.go @@ -12,6 +12,7 @@ import ( "strings" "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/models/webhook" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/storage" @@ -113,13 +114,13 @@ func GenerateGitHooks(ctx context.Context, templateRepo, generateRepo *Repositor // GenerateWebhooks generates webhooks from a template repository func GenerateWebhooks(ctx context.Context, templateRepo, generateRepo *Repository) error { - templateWebhooks, err := ListWebhooksByOpts(&ListWebhookOptions{RepoID: templateRepo.ID}) + templateWebhooks, err := webhook.ListWebhooksByOpts(&webhook.ListWebhookOptions{RepoID: templateRepo.ID}) if err != nil { return err } for _, templateWebhook := range templateWebhooks { - generateWebhook := &Webhook{ + generateWebhook := &webhook.Webhook{ RepoID: generateRepo.ID, URL: templateWebhook.URL, HTTPMethod: templateWebhook.HTTPMethod, @@ -132,7 +133,7 @@ func GenerateWebhooks(ctx context.Context, templateRepo, generateRepo *Repositor Events: templateWebhook.Events, Meta: templateWebhook.Meta, } - if err := createWebhook(db.GetEngine(ctx), generateWebhook); err != nil { + if err := webhook.CreateWebhook(ctx, generateWebhook); err != nil { return err } } |