perf: directory service db

This commit is contained in:
ibuler
2025-04-15 20:20:47 +08:00
committed by 老广
parent e286997090
commit 1fdd1036d3
8 changed files with 61 additions and 16 deletions

View File

@@ -141,16 +141,14 @@ class Account(AbsConnectivity, LabeledMixin, BaseAccount, JSONFilterMixin):
def is_ds_account(self):
if self.username.startswith('@'):
return False
if self.platform.category == 'ds':
return True
return False
if not self.asset.is_directory_service:
return False
return True
@lazyproperty
def ds(self):
if not self.is_ds_account():
return None
if not hasattr(self.asset, 'ds'):
return None
return self.asset.ds
@lazyproperty