mirror of https://github.com/jumpserver/jumpserver
[Update] 修改profile serialzier
parent
dd5bf546df
commit
195cbbbe42
|
@ -181,16 +181,19 @@ class ResetOTPSerializer(serializers.Serializer):
|
|||
pass
|
||||
|
||||
|
||||
class UserProfileSerializer(serializers.ModelSerializer):
|
||||
class UserProfileSerializer(UserSerializer):
|
||||
admin_or_audit_orgs = UserOrgSerializer(many=True, read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = [
|
||||
'id', 'name', 'username', 'email',
|
||||
'role', 'wechat', 'phone', 'mfa_level',
|
||||
'comment', 'source', 'is_valid', 'is_expired',
|
||||
'is_active', 'created_by', 'is_first_login',
|
||||
'date_password_last_updated', 'date_expired',
|
||||
'avatar_url', 'groups', 'admin_or_audit_orgs',
|
||||
class Meta(UserSerializer.Meta):
|
||||
# fields = [
|
||||
# 'id', 'name', 'username', 'email',
|
||||
# 'role', 'wechat', 'phone', 'mfa_level',
|
||||
# 'comment', 'source', 'is_valid', 'is_expired',
|
||||
# 'is_active', 'created_by', 'is_first_login',
|
||||
# 'date_password_last_updated', 'date_expired',
|
||||
# 'avatar_url', 'groups', 'admin_or_audit_orgs',
|
||||
# ]
|
||||
fields = UserSerializer.Meta.fields + [
|
||||
'admin_or_audit_orgs'
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue