Browse Source

perf: 优化获取账号 su-from-accounts 时,不包含自己和以自己为 su-from 的账号

pull/9182/head
Bai 2 years ago
parent
commit
beac2a1514
  1. 3
      apps/assets/models/account.py

3
apps/assets/models/account.py

@ -88,7 +88,8 @@ class Account(AbsConnectivity, BaseAccount):
return cls(name=cls.AliasAccount.USER.label, username=cls.AliasAccount.USER.value)
def get_su_from_accounts(self):
return self.asset.accounts.exclude(id=self.id)
""" 排除自己和以自己为 su-from 的账号 """
return self.asset.accounts.exclude(id=self.id).exclude(su_from=self)
class AccountTemplate(BaseAccount):

Loading…
Cancel
Save