perf: 修复登录和推送系统用户是密码选择

This commit is contained in:
ibuler
2022-01-19 15:50:42 +08:00
committed by Jiangjie.Bai
parent 83c5344307
commit 89c7e514eb
2 changed files with 4 additions and 2 deletions

View File

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