diff options
author | Russell Aunger <rba@live.com> | 2019-03-18 22:33:20 -0400 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-03-18 22:33:20 -0400 |
commit | b34996a62937b23121d19912b37ed2b1023f1479 (patch) | |
tree | 9a080ef145d738c71956279980bd7f56b70b6825 /models/repo.go | |
parent | cac9e6e7605184f5679b1ebfbe5b5805191d9a53 (diff) | |
download | gitea-b34996a62937b23121d19912b37ed2b1023f1479.tar.gz gitea-b34996a62937b23121d19912b37ed2b1023f1479.zip |
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.
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 4 insertions, 0 deletions
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 } |