diff --git a/pkg/compute/models/cloudaccounts.go b/pkg/compute/models/cloudaccounts.go index 668d2e4029..e0dba49330 100644 --- a/pkg/compute/models/cloudaccounts.go +++ b/pkg/compute/models/cloudaccounts.go @@ -161,7 +161,7 @@ func (self *SCloudaccount) ValidateDeleteCondition(ctx context.Context) error { if self.Enabled { return httperrors.NewInvalidStatusError("account is enabled") } - if self.getSyncStatus2() != api.CLOUD_PROVIDER_SYNC_STATUS_IDLE { + if self.Status == api.CLOUD_PROVIDER_CONNECTED && self.getSyncStatus2() != api.CLOUD_PROVIDER_SYNC_STATUS_IDLE { return httperrors.NewInvalidStatusError("account is not idle") } cloudproviders := self.GetCloudproviders()