fix: 修改用户序列类read_only字段 (#5729)

* fix: 修改用户序列类read_only字段

Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com>
Co-authored-by: Bai <bugatti_it@163.com>
pull/5728/head
fit2bot 4 years ago committed by GitHub
parent 83829df70c
commit 5b2649f775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,11 +27,11 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer):
choices=PASSWORD_STRATEGY_CHOICES, required=False, choices=PASSWORD_STRATEGY_CHOICES, required=False,
label=_('Password strategy'), write_only=True, default=0 label=_('Password strategy'), write_only=True, default=0
) )
mfa_enabled = serializers.BooleanField(label=_('MFA enabled')) mfa_enabled = serializers.BooleanField(read_only=True, label=_('MFA enabled'))
mfa_force_enabled = serializers.BooleanField(label=_('MFA force enabled')) mfa_force_enabled = serializers.BooleanField(read_only=True, label=_('MFA force enabled'))
mfa_level_display = serializers.ReadOnlyField(source='get_mfa_level_display', label=_('MFA level for display')) mfa_level_display = serializers.ReadOnlyField(source='get_mfa_level_display', label=_('MFA level for display'))
login_blocked = serializers.BooleanField(label=_('Login blocked')) login_blocked = serializers.BooleanField(read_only=True, label=_('Login blocked'))
is_expired = serializers.BooleanField(label=_('Is expired')) is_expired = serializers.BooleanField(read_only=True, label=_('Is expired'))
can_update = serializers.SerializerMethodField(label=_('Can update')) can_update = serializers.SerializerMethodField(label=_('Can update'))
can_delete = serializers.SerializerMethodField(label=_('Can delete')) can_delete = serializers.SerializerMethodField(label=_('Can delete'))
org_roles = serializers.ListField( org_roles = serializers.ListField(

Loading…
Cancel
Save