mirror of https://github.com/jumpserver/jumpserver
perf: 修复登录和推送系统用户是密码选择
parent
83c5344307
commit
89c7e514eb
|
@ -150,7 +150,9 @@ class AuthMixin:
|
|||
def load_asset_special_auth(self, asset, username=''):
|
||||
"""
|
||||
"""
|
||||
authbooks = list(AuthBook.objects.filter(asset=asset, systemuser=self))
|
||||
authbooks = AuthBook.objects.filter(asset=asset).filter(
|
||||
Q(username=username) | Q(systemuser=self)
|
||||
)
|
||||
if len(authbooks) == 0:
|
||||
return None
|
||||
elif len(authbooks) == 1:
|
||||
|
|
|
@ -245,7 +245,7 @@ def push_system_user_util(system_user, assets, task_name, username=None):
|
|||
special_auth_set = set()
|
||||
|
||||
auth_books = AuthBook.objects.filter(asset_id__in=asset_ids).filter(
|
||||
Q(username__in=usernames) | Q(systemuser__username__in=usernames)
|
||||
Q(username__in=usernames) | Q(systemuser=system_user)
|
||||
).prefetch_related('systemuser')
|
||||
|
||||
for auth_book in auth_books:
|
||||
|
|
Loading…
Reference in New Issue