From beac2a15145e72cea75e134f04e0d1dafca6eba0 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 8 Dec 2022 13:37:35 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=20su-from-accounts=20=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E5=90=AB=E8=87=AA=E5=B7=B1=E5=92=8C=E4=BB=A5?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E4=B8=BA=20su-from=20=E7=9A=84=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/models/account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/assets/models/account.py b/apps/assets/models/account.py index 7703ac1e6..dbdcd21fd 100644 --- a/apps/assets/models/account.py +++ b/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):