mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 16:16:35 -05:00
3d9ed62f4a
Fixes #24624 This seems to have been broken in https://github.com/go-gitea/gitea/pull/21563 Previously, this code read ``` // Are we looking at default webhooks? if ctx.Params(":configType") == "default-hooks" { return &orgRepoCtx{ IsAdmin: true, Link: path.Join(setting.AppSubURL, "/admin/hooks"), LinkNew: path.Join(setting.AppSubURL, "/admin/default-hooks"), NewTemplate: tplAdminHookNew, }, nil } // Must be system webhooks instead return &orgRepoCtx{ IsAdmin: true, IsSystemWebhook: true, Link: path.Join(setting.AppSubURL, "/admin/hooks"), LinkNew: path.Join(setting.AppSubURL, "/admin/system-hooks"), NewTemplate: tplAdminHookNew, }, nil ``` but was simplified to ``` return &ownerRepoCtx{ IsAdmin: true, IsSystemWebhook: ctx.Params(":configType") == "system-hooks", Link: path.Join(setting.AppSubURL, "/admin/hooks"), LinkNew: path.Join(setting.AppSubURL, "/admin/system-hooks"), NewTemplate: tplAdminHookNew, }, nil ``` In other words, combining the `IsSystemWebhook` check into a one-liner and forgetting that `LinkNew` also depended on it. This meant the rendered `<form>` always POSTed to `/admin/system-hooks`, even when you had GETed `/admin/default-hooks/gitea/new`. |
||
---|---|---|
.. | ||
actions | ||
setting | ||
activity.go | ||
attachment.go | ||
blame.go | ||
branch.go | ||
cherry_pick.go | ||
commit.go | ||
compare.go | ||
download.go | ||
editor.go | ||
editor_test.go | ||
find.go | ||
helper.go | ||
helper_test.go | ||
http.go | ||
http_test.go | ||
issue.go | ||
issue_content_history.go | ||
issue_dependency.go | ||
issue_label.go | ||
issue_label_test.go | ||
issue_lock.go | ||
issue_stopwatch.go | ||
issue_test.go | ||
issue_timetrack.go | ||
issue_watch.go | ||
lfs.go | ||
main_test.go | ||
middlewares.go | ||
migrate.go | ||
milestone.go | ||
packages.go | ||
patch.go | ||
projects.go | ||
projects_test.go | ||
pull.go | ||
pull_review.go | ||
release.go | ||
release_test.go | ||
render.go | ||
repo.go | ||
search.go | ||
setting.go | ||
setting_protected_branch.go | ||
settings_test.go | ||
tag.go | ||
topic.go | ||
treelist.go | ||
view.go | ||
view_test.go | ||
webhook.go | ||
wiki.go | ||
wiki_test.go |