perf: 修改发布机账号选择

pull/11113/head
ibuler 1 year ago
parent 58124af1ce
commit 107fda0f99

@ -216,9 +216,11 @@ class Applet(JMSBaseModel):
if private_account and private_account.username not in accounts_username_used:
account = private_account
else:
accounts = accounts.exclude(username__in=accounts_username_used) \
.filter(username__startswith='jms_')
account = self.random_select_prefer_account(user, host, accounts)
accounts = accounts.exclude(username__in=accounts_username_used)
public_accounts = accounts.filter(username__startswith='jms_{}'.format(self.name))
if not public_accounts:
public_accounts = accounts.exclude(username__in=['Administrator', 'root'])
account = self.random_select_prefer_account(user, host, public_accounts)
if not account:
return
ttl = 60 * 60 * 24

Loading…
Cancel
Save