perf: 优化 applet 账号选择

pull/12387/head
ibuler 2023-12-05 11:39:19 +08:00 committed by Bryan
parent 0fbbdceec2
commit 2a23af5030
1 changed files with 3 additions and 1 deletions

View File

@ -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