Merge pull request #11250 from jumpserver/pr@dev@perf_applet_gen_private_account

perf: 账号生成时,排除 [ 开头的
This commit is contained in:
老广
2023-08-10 18:28:36 +08:00
committed by GitHub
7 changed files with 36 additions and 25 deletions

View File

@@ -125,6 +125,7 @@ class AppletHost(Host):
from users.models import User
usernames = User.objects \
.filter(is_active=True, is_service_account=False) \
.exclude(username__startswith='[') \
.values_list('username', flat=True)
account_usernames = self.accounts.all().values_list('username', flat=True)
account_usernames = [username[3:] for username in account_usernames if username.startswith('js_')]