From b34996a62937b23121d19912b37ed2b1023f1479 Mon Sep 17 00:00:00 2001 From: Russell Aunger Date: Mon, 18 Mar 2019 22:33:20 -0400 Subject: Implement Default Webhooks (#4299) Partially implement #770. Add "Default Webhooks" page in site admin UI. Persist to the existing webhooks table, but store with RepoID=0 and OrgID=0. Upon repo creation, copy the set of default webhooks into the new repo. --- models/repo.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models/repo.go') diff --git a/models/repo.go b/models/repo.go index cafde29363..9a85c77f0c 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1366,6 +1366,10 @@ func createRepository(e *xorm.Session, doer, u *User, repo *Repository) (err err return fmt.Errorf("newRepoAction: %v", err) } + if err = copyDefaultWebhooksToRepo(e, repo.ID); err != nil { + return fmt.Errorf("copyDefaultWebhooksToRepo: %v", err) + } + return nil } -- cgit v1.2.3