mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-10 20:31:25 +02:00
Backport #37546 by @KalashThakare This PR fixes issue #37523: 1. Prevents a 500 error on the Actions page when disabling workflows with an empty workflow parameter 2. Uses a single **ctx.JSONError** in the handler to return 400 Bad Request with the message “workflow is required” for empty input Co-authored-by: Kalash Thakare ☯︎ <kalashthakare898@gmail.com>
This commit is contained in:
parent
b79529015e
commit
356a119f30
@ -949,7 +949,7 @@ func EnableWorkflowFile(ctx *context_module.Context) {
|
|||||||
func disableOrEnableWorkflowFile(ctx *context_module.Context, isEnable bool) {
|
func disableOrEnableWorkflowFile(ctx *context_module.Context, isEnable bool) {
|
||||||
workflow := ctx.FormString("workflow")
|
workflow := ctx.FormString("workflow")
|
||||||
if len(workflow) == 0 {
|
if len(workflow) == 0 {
|
||||||
ctx.ServerError("workflow", nil)
|
ctx.JSONError("workflow is required")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user