mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-22 02:35:55 +00:00
[v11.0/forgejo] fix: validate input for default_{merge,update}_style (#7401)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/7395 - Add `binding:"In(...)"` to the `default_merge_style` and `default_update_style` fields to only accept recognized merge and update styles. - Resolves forgejo/forgejo#7389 - Added integration test for the API (`binding` works in the exact same way for the API and web routes). Co-authored-by: Gusted <postmaster@gusted.xyz> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7401 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
parent
1d1e0ced3e
commit
fa8d75b3e5
5 changed files with 248 additions and 216 deletions
|
@ -105,6 +105,10 @@ func Units(ctx *context.Context) {
|
|||
|
||||
func UnitsPost(ctx *context.Context) {
|
||||
form := web.GetForm(ctx).(*forms.RepoUnitSettingForm)
|
||||
if ctx.HasError() {
|
||||
ctx.Redirect(ctx.Repo.Repository.Link() + "/settings/units")
|
||||
return
|
||||
}
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue