From aa9533eb5b4dafea99c0ee85f81f9d8860107095 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 29 Apr 2020 10:19:25 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20Groups=20users=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/serializers/group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/serializers/group.py b/apps/users/serializers/group.py index 67b21668c..078ceb8a8 100644 --- a/apps/users/serializers/group.py +++ b/apps/users/serializers/group.py @@ -18,7 +18,7 @@ __all__ = [ class UserGroupSerializer(BulkOrgResourceModelSerializer): users = serializers.PrimaryKeyRelatedField( 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: @@ -38,7 +38,7 @@ class UserGroupSerializer(BulkOrgResourceModelSerializer): def set_fields_queryset(self): 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): for user in users: