fix: authbook load asset queryset bug

This commit is contained in:
feng626 2022-01-20 10:56:49 +08:00 committed by Jiangjie.Bai
parent 9e47bf6ec5
commit 46270fd91c

View File

@ -151,9 +151,9 @@ class AuthMixin:
def load_asset_special_auth(self, asset, username=''):
"""
"""
authbooks = AuthBook.objects.filter(asset=asset).filter(
authbooks = list(AuthBook.objects.filter(asset=asset).filter(
Q(username=username) | Q(systemuser=self)
)
))
if len(authbooks) == 0:
return None
elif len(authbooks) == 1: