Merge pull request '[TESTS] webhook forms creation and edition' (#2755) from oliverpool/forgejo:webhook_1_tests into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2755
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-03-24 05:35:07 +00:00
commit b7c535dba8
3 changed files with 341 additions and 2 deletions

View file

@ -214,9 +214,10 @@ func createWebhook(ctx *context.Context, params webhookParams) {
return
}
ctx.Data["BaseLink"] = orCtx.LinkNew
ctx.Data["BaseLinkNew"] = orCtx.LinkNew
if ctx.HasError() {
ctx.HTML(http.StatusOK, orCtx.NewTemplate)
ctx.HTML(http.StatusUnprocessableEntity, orCtx.NewTemplate)
return
}
@ -271,7 +272,7 @@ func editWebhook(ctx *context.Context, params webhookParams) {
ctx.Data["Webhook"] = w
if ctx.HasError() {
ctx.HTML(http.StatusOK, orCtx.NewTemplate)
ctx.HTML(http.StatusUnprocessableEntity, orCtx.NewTemplate)
return
}