summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorRussell Aunger <rba@live.com>2019-03-18 22:33:20 -0400
committertechknowlogick <matti@mdranta.net>2019-03-18 22:33:20 -0400
commitb34996a62937b23121d19912b37ed2b1023f1479 (patch)
tree9a080ef145d738c71956279980bd7f56b70b6825 /models/repo.go
parentcac9e6e7605184f5679b1ebfbe5b5805191d9a53 (diff)
downloadgitea-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.go4
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
}