summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/repository/hooks.go2
-rw-r--r--services/webhook/webhook.go10
2 files changed, 6 insertions, 6 deletions
diff --git a/services/repository/hooks.go b/services/repository/hooks.go
index a8b6f7a622..8506fa3413 100644
--- a/services/repository/hooks.go
+++ b/services/repository/hooks.go
@@ -101,7 +101,7 @@ func GenerateWebhooks(ctx context.Context, templateRepo, generateRepo *repo_mode
HookEvent: templateWebhook.HookEvent,
IsActive: templateWebhook.IsActive,
Type: templateWebhook.Type,
- OrgID: templateWebhook.OrgID,
+ OwnerID: templateWebhook.OwnerID,
Events: templateWebhook.Events,
Meta: templateWebhook.Meta,
})
diff --git a/services/webhook/webhook.go b/services/webhook/webhook.go
index afd8e3c105..b862d5bff1 100644
--- a/services/webhook/webhook.go
+++ b/services/webhook/webhook.go
@@ -229,16 +229,16 @@ func PrepareWebhooks(ctx context.Context, source EventSource, event webhook_modu
owner = source.Repository.MustOwner(ctx)
}
- // check if owner is an org and append additional webhooks
- if owner != nil && owner.IsOrganization() {
- orgHooks, err := webhook_model.ListWebhooksByOpts(ctx, &webhook_model.ListWebhookOptions{
- OrgID: owner.ID,
+ // append additional webhooks of a user or organization
+ if owner != nil {
+ ownerHooks, err := webhook_model.ListWebhooksByOpts(ctx, &webhook_model.ListWebhookOptions{
+ OwnerID: owner.ID,
IsActive: util.OptionalBoolTrue,
})
if err != nil {
return fmt.Errorf("ListWebhooksByOpts: %w", err)
}
- ws = append(ws, orgHooks...)
+ ws = append(ws, ownerHooks...)
}
// Add any admin-defined system webhooks