From 5a34372ca57d5c4147a3945d70851db62ed1f1e6 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 17 Apr 2023 17:46:10 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=89=B9=E9=87=8F=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=20=E6=B2=A1=E8=A7=A3=E5=AF=86=20(#10226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/serializers/account/account.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/accounts/serializers/account/account.py b/apps/accounts/serializers/account/account.py index 1827ed439..9ebbeda51 100644 --- a/apps/accounts/serializers/account/account.py +++ b/apps/accounts/serializers/account/account.py @@ -14,7 +14,7 @@ from assets.models import Asset from common.serializers import SecretReadableMixin from common.serializers.fields import ObjectRelatedField, LabeledChoiceField from common.utils import get_logger -from .base import BaseAccountSerializer +from .base import BaseAccountSerializer, AuthValidateMixin logger = get_logger(__name__) @@ -228,7 +228,9 @@ class AssetAccountBulkSerializerResultSerializer(serializers.Serializer): changed = serializers.BooleanField(read_only=True, label=_('Changed')) -class AssetAccountBulkSerializer(AccountCreateUpdateSerializerMixin, serializers.ModelSerializer): +class AssetAccountBulkSerializer( + AccountCreateUpdateSerializerMixin, AuthValidateMixin, serializers.ModelSerializer +): assets = serializers.PrimaryKeyRelatedField(queryset=Asset.objects, many=True, label=_('Assets')) class Meta: