mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-08 10:49:08 +00:00
perf: 优化 applet 账号选择
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user