perf: applet account select

This commit is contained in:
ibuler
2025-04-16 16:35:49 +08:00
committed by Eric_Lee
parent fa70fb2921
commit 1ee70af93d
5 changed files with 105 additions and 52 deletions

View File

@@ -92,8 +92,9 @@ class VirtualAccount(JMSOrgBaseModel):
from .account import Account
username = user.username
alias = AliasAccount.USER.value
with tmp_to_org(asset.org):
same_account = cls.objects.filter(alias='@USER').first()
same_account = cls.objects.filter(alias=alias).first()
secret = ''
if same_account and same_account.secret_from_login:
@@ -101,4 +102,6 @@ class VirtualAccount(JMSOrgBaseModel):
if not secret and not from_permed:
secret = input_secret
return Account(name=AliasAccount.USER.label, username=username, secret=secret)
account = Account(name=AliasAccount.USER.label, username=username, secret=secret)
account.alias = alias
return account