From 61cd08fa13539b9ae625d0dbcdbcc3450b27e650 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 18 Oct 2023 22:18:45 +0200 Subject: [PATCH] fix(webhooks): add created by user object when creating a webhook --- pkg/models/webhooks.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/models/webhooks.go b/pkg/models/webhooks.go index cc8884d437b..b40c94d6a1e 100644 --- a/pkg/models/webhooks.go +++ b/pkg/models/webhooks.go @@ -116,6 +116,11 @@ func (w *Webhook) Create(s *xorm.Session, a web.Auth) (err error) { // TODO: check valid webhook events w.CreatedByID = a.GetID() _, err = s.Insert(w) + if err != nil { + return err + } + + w.CreatedBy, err = user.GetUserByID(s, a.GetID()) return }