mirror of https://github.com/jumpserver/jumpserver
[Update] Groups users字段可以显示
parent
5f2c9c3801
commit
aa9533eb5b
|
@ -18,7 +18,7 @@ __all__ = [
|
||||||
class UserGroupSerializer(BulkOrgResourceModelSerializer):
|
class UserGroupSerializer(BulkOrgResourceModelSerializer):
|
||||||
users = serializers.PrimaryKeyRelatedField(
|
users = serializers.PrimaryKeyRelatedField(
|
||||||
required=False, many=True, queryset=User.objects, label=_('User'),
|
required=False, many=True, queryset=User.objects, label=_('User'),
|
||||||
write_only=True
|
# write_only=True, group can return many to many on detail
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -38,7 +38,7 @@ class UserGroupSerializer(BulkOrgResourceModelSerializer):
|
||||||
|
|
||||||
def set_fields_queryset(self):
|
def set_fields_queryset(self):
|
||||||
users_field = self.fields['users']
|
users_field = self.fields['users']
|
||||||
users_field.child_relation.queryset = utils.get_current_org_members()
|
users_field.child_relation.queryset = utils.get_current_org_members(exclude=('Auditor',))
|
||||||
|
|
||||||
def validate_users(self, users):
|
def validate_users(self, users):
|
||||||
for user in users:
|
for user in users:
|
||||||
|
|
Loading…
Reference in New Issue