mirror of https://github.com/jumpserver/jumpserver
fix: 修复 applet 账号选择问题
parent
a6b59ad7d6
commit
e2602127c4
|
@ -166,6 +166,7 @@ class UsernameHintsAPI(APIView):
|
||||||
|
|
||||||
top_accounts = Account.objects \
|
top_accounts = Account.objects \
|
||||||
.exclude(username__startswith='jms_') \
|
.exclude(username__startswith='jms_') \
|
||||||
|
.exclude(username__startswith='js_') \
|
||||||
.filter(username__icontains=query) \
|
.filter(username__icontains=query) \
|
||||||
.filter(asset__in=assets) \
|
.filter(asset__in=assets) \
|
||||||
.values('username') \
|
.values('username') \
|
||||||
|
|
|
@ -193,7 +193,7 @@ class Applet(JMSBaseModel):
|
||||||
if private_account and private_account.username not in accounts_username_used:
|
if private_account and private_account.username not in accounts_username_used:
|
||||||
account = private_account
|
account = private_account
|
||||||
else:
|
else:
|
||||||
accounts = accounts.exclude(username__in=accounts_username_used)
|
accounts = accounts.exclude(username__in=accounts_username_used).filter(username__startswith='jms_')
|
||||||
account = self.random_select_prefer_account(user, host, accounts)
|
account = self.random_select_prefer_account(user, host, accounts)
|
||||||
if not account:
|
if not account:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue