diff --git a/apps/users/serializers/group.py b/apps/users/serializers/group.py index 8dba1025d..102b562a8 100644 --- a/apps/users/serializers/group.py +++ b/apps/users/serializers/group.py @@ -53,3 +53,7 @@ class UserGroupSerializer(BulkOrgResourceModelSerializer): Prefetch('users', queryset=User.objects.only('id')) ).annotate(users_amount=Count('users')) return queryset + + def validate_users(self, users): + users = [user for user in users if user.role != User.ROLE.AUDITOR] + return users