fix: 修复账号模版切换时报错的问题

pull/11010/head
Bai 2023-07-19 10:33:12 +08:00 committed by Bryan
parent 02d0c7e4e7
commit aa744c0fec
1 changed files with 4 additions and 1 deletions

View File

@ -140,7 +140,10 @@ class AccountTemplate(BaseAccount):
def get_su_from_account_templates(cls, pk=None):
if pk is None:
return cls.objects.all()
return cls.objects.exclude(Q(id=pk) | Q(_id=pk))
return cls.objects.exclude(Q(id=pk) | Q(su_from_id=pk))
def __str__(self):
return f'{self.name}({self.username})'
def get_su_from_account(self, asset):
su_from = self.su_from