mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #4498 from swordqiu/hotfix/qj-allow-delete-auto-sync-enabled-cloud-account
fix: allow delete cloudaccount with auto-sync enabled
This commit is contained in:
@@ -163,9 +163,10 @@ func (self *SCloudaccount) getCloudprovidersInternal(enabled tristate.TriState)
|
||||
}
|
||||
|
||||
func (self *SCloudaccount) ValidateDeleteCondition(ctx context.Context) error {
|
||||
if self.EnableAutoSync {
|
||||
return httperrors.NewInvalidStatusError("automatic syncing is enabled")
|
||||
}
|
||||
// allow delete cloudaccount if it is disabled
|
||||
// if self.EnableAutoSync {
|
||||
// return httperrors.NewInvalidStatusError("automatic syncing is enabled")
|
||||
// }
|
||||
if self.Enabled {
|
||||
return httperrors.NewInvalidStatusError("account is enabled")
|
||||
}
|
||||
|
||||
@@ -109,10 +109,11 @@ func (self *SCloudprovider) AllowDeleteItem(ctx context.Context, userCred mcclie
|
||||
}
|
||||
|
||||
func (self *SCloudprovider) ValidateDeleteCondition(ctx context.Context) error {
|
||||
account := self.GetCloudaccount()
|
||||
if account != nil && account.EnableAutoSync {
|
||||
return httperrors.NewInvalidStatusError("auto syncing is enabled on account")
|
||||
}
|
||||
// allow delete cloudprovider if it is disabled
|
||||
// account := self.GetCloudaccount()
|
||||
// if account != nil && account.EnableAutoSync {
|
||||
// return httperrors.NewInvalidStatusError("auto syncing is enabled on account")
|
||||
// }
|
||||
if self.Enabled {
|
||||
return httperrors.NewInvalidStatusError("provider is enabled")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user