From 7ef09a4ca1ae7845f602d6f55664638981ee93c2 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 8 Jun 2020 17:16:30 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20UserSerializer=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20login=5Fconfirm=5Fsettings=20(#4086)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/serializers/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index 019524cae..fcbde6150 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -40,6 +40,7 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer): login_blocked = serializers.SerializerMethodField() can_update = serializers.SerializerMethodField() can_delete = serializers.SerializerMethodField() + login_confirm_settings = serializers.PrimaryKeyRelatedField(read_only=True, source='login_confirm_setting.reviewers', many=True) key_prefix_block = "_LOGIN_BLOCK_{}" @@ -59,7 +60,7 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer): ] fields = fields_small + [ 'groups', 'role', 'groups_display', 'role_display', - 'can_update', 'can_delete', 'login_blocked', + 'can_update', 'can_delete', 'login_blocked', 'login_confirm_settings' ] extra_kwargs = {