mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
proxysetting: forbid deletion of DIRECT setting
This commit is contained in:
@@ -74,6 +74,9 @@ func (ps *SProxySetting) HttpTransportProxyFunc() httputils.TransportProxyFunc {
|
||||
}
|
||||
|
||||
func (ps *SProxySetting) ValidateDeleteCondition(ctx context.Context) error {
|
||||
if ps.Id == proxyapi.ProxySettingId_DIRECT {
|
||||
return httperrors.NewConflictError("DIRECT setting cannot be deleted")
|
||||
}
|
||||
for _, man := range referrersMen {
|
||||
t := man.TableSpec().Instance()
|
||||
n, err := t.Query().
|
||||
|
||||
Reference in New Issue
Block a user