[Update] UserSerializer 添加 login_confirm_settings (#4086)

pull/4088/head
xinwen 2020-06-08 17:16:30 +08:00 committed by GitHub
parent 31daaed4cd
commit 7ef09a4ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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 = {