mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
enhance: Improve validation errors for secrets/variables (#39221)
Signed-off-by: Ross Golder <ross@golder.org> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
ce2fd8d882
commit
2d3ad4a530
@@ -5,7 +5,6 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
system_model "gitea.dev/models/system"
|
||||
@@ -161,11 +160,7 @@ loop:
|
||||
|
||||
err := validateConfigKeyValue(key, value)
|
||||
if err != nil {
|
||||
if errors.Is(err, util.ErrInvalidArgument) {
|
||||
ctx.JSONError(err.Error())
|
||||
} else {
|
||||
ctx.JSONError(ctx.Tr("admin.config.set_setting_failed", key))
|
||||
}
|
||||
ctx.JSONErrorAuto(err)
|
||||
break loop
|
||||
}
|
||||
configSettings[key] = value
|
||||
|
||||
Reference in New Issue
Block a user