aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/webhook.go')
-rw-r--r--routers/web/repo/webhook.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/repo/webhook.go b/routers/web/repo/webhook.go
index f30588967e..a21b405c96 100644
--- a/routers/web/repo/webhook.go
+++ b/routers/web/repo/webhook.go
@@ -67,7 +67,7 @@ type ownerRepoCtx struct {
// getOwnerRepoCtx determines whether this is a repo, owner, or admin (both default and system) context.
func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
- if is, ok := ctx.Data["IsRepositoryWebhook"]; ok && is.(bool) {
+ if ctx.Data["PageIsRepoSettings"] == true {
return &ownerRepoCtx{
RepoID: ctx.Repo.Repository.ID,
Link: path.Join(ctx.Repo.RepoLink, "settings/hooks"),
@@ -76,7 +76,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
}, nil
}
- if is, ok := ctx.Data["IsOrganizationWebhook"]; ok && is.(bool) {
+ if ctx.Data["PageIsOrgSettings"] == true {
return &ownerRepoCtx{
OwnerID: ctx.ContextUser.ID,
Link: path.Join(ctx.Org.OrgLink, "settings/hooks"),
@@ -85,7 +85,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
}, nil
}
- if is, ok := ctx.Data["IsUserWebhook"]; ok && is.(bool) {
+ if ctx.Data["PageIsUserSettings"] == true {
return &ownerRepoCtx{
OwnerID: ctx.Doer.ID,
Link: path.Join(setting.AppSubURL, "/user/settings/hooks"),
@@ -94,7 +94,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
}, nil
}
- if ctx.Doer.IsAdmin {
+ if ctx.Data["PageIsAdmin"] == true {
return &ownerRepoCtx{
IsAdmin: true,
IsSystemWebhook: ctx.Params(":configType") == "system-hooks",