mirror of https://github.com/jumpserver/jumpserver
perf: 优化 applet 账号选择
parent
0fbbdceec2
commit
2a23af5030
|
@ -223,7 +223,9 @@ class Applet(JMSBaseModel):
|
||||||
accounts = valid_accounts.exclude(username__in=accounts_username_used)
|
accounts = valid_accounts.exclude(username__in=accounts_username_used)
|
||||||
public_accounts = accounts.filter(username__startswith='jms_')
|
public_accounts = accounts.filter(username__startswith='jms_')
|
||||||
if not public_accounts:
|
if not public_accounts:
|
||||||
public_accounts = accounts.exclude(username__in=['Administrator', 'root'])
|
public_accounts = accounts \
|
||||||
|
.exclude(username__in=['Administrator', 'root']) \
|
||||||
|
.exclude(username__startswith='js_')
|
||||||
account = self.random_select_prefer_account(user, host, public_accounts)
|
account = self.random_select_prefer_account(user, host, public_accounts)
|
||||||
return account
|
return account
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue