mirror of https://github.com/jumpserver/jumpserver
Merge pull request #3869 from jumpserver/lina_user
[Update] 修改用户Profile序列类返回的admin_orgspull/3871/head
commit
88fcf8dbd7
|
@ -563,10 +563,10 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, AbstractUser):
|
|||
user_default = settings.STATIC_URL + "img/avatar/user.png"
|
||||
return user_default
|
||||
|
||||
def admin_orgs(self):
|
||||
from orgs.models import Organization
|
||||
orgs = Organization.get_user_admin_or_audit_orgs(self)
|
||||
return orgs
|
||||
# def admin_orgs(self):
|
||||
# from orgs.models import Organization
|
||||
# orgs = Organization.get_user_admin_or_audit_orgs(self)
|
||||
# return orgs
|
||||
|
||||
def avatar_url(self):
|
||||
admin_default = settings.STATIC_URL + "img/avatar/admin.png"
|
||||
|
|
|
@ -178,7 +178,7 @@ class ResetOTPSerializer(serializers.Serializer):
|
|||
|
||||
|
||||
class UserProfileSerializer(serializers.ModelSerializer):
|
||||
admin_orgs = UserOrgSerializer(many=True, read_only=True)
|
||||
admin_or_audit_orgs = UserOrgSerializer(many=True, read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
|
@ -188,7 +188,5 @@ class UserProfileSerializer(serializers.ModelSerializer):
|
|||
'comment', 'source', 'is_valid', 'is_expired',
|
||||
'is_active', 'created_by', 'is_first_login',
|
||||
'date_password_last_updated', 'date_expired',
|
||||
'avatar_url',
|
||||
|
||||
'groups', 'admin_orgs',
|
||||
'avatar_url', 'groups', 'admin_or_audit_orgs',
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue