mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
#3274 fix can't get webhook detail of organization
This commit is contained in:
parent
fff615d5fc
commit
3d93532c87
5 changed files with 26 additions and 9 deletions
|
@ -220,7 +220,12 @@ func checkWebhook(ctx *context.Context) (*OrgRepoCtx, *models.Webhook) {
|
|||
}
|
||||
ctx.Data["BaseLink"] = orCtx.Link
|
||||
|
||||
w, err := models.GetWebhookByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||
var w *models.Webhook
|
||||
if orCtx.RepoID > 0 {
|
||||
w, err = models.GetWebhookByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||
} else {
|
||||
w, err = models.GetWebhookByOrgID(ctx.Org.Organization.Id, ctx.ParamsInt64(":id"))
|
||||
}
|
||||
if err != nil {
|
||||
if models.IsErrWebhookNotExist(err) {
|
||||
ctx.Handle(404, "GetWebhookByID", nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue