From 10e3100d3c66f962549f1367036de10fb38df112 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 1 Dec 2022 22:09:16 +0800 Subject: [PATCH] fix: LoginAssetACL confirm action --- apps/acls/api/login_asset_check.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/acls/api/login_asset_check.py b/apps/acls/api/login_asset_check.py index 04042473f..6ebee2579 100644 --- a/apps/acls/api/login_asset_check.py +++ b/apps/acls/api/login_asset_check.py @@ -1,10 +1,10 @@ -from rest_framework.response import Response from rest_framework.generics import CreateAPIView +from rest_framework.response import Response from common.utils import reverse, lazyproperty from orgs.utils import tmp_to_org -from ..models import LoginAssetACL from .. import serializers +from ..models import LoginAssetACL __all__ = ['LoginAssetCheckAPI'] @@ -31,12 +31,12 @@ class LoginAssetCheckAPI(CreateAPIView): def check_confirm(self): with tmp_to_org(self.serializer.asset.org): - acl = LoginAssetACL.objects\ - .filter(action=LoginAssetACL.ActionChoices.login_confirm)\ - .filter_user(self.serializer.user)\ - .filter_asset(self.serializer.asset)\ - .filter_account(self.serializer.validated_data.get('account_username'))\ - .valid()\ + acl = LoginAssetACL.objects \ + .filter(action=LoginAssetACL.ActionChoices.confirm) \ + .filter_user(self.serializer.user) \ + .filter_asset(self.serializer.asset) \ + .filter_account(self.serializer.validated_data.get('account_username')) \ + .valid() \ .first() if acl: need_confirm = True