From 6b5435b768217b9a9482c3b25a0322681f6fce37 Mon Sep 17 00:00:00 2001 From: xinwen Date: Tue, 30 Mar 2021 09:39:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Default=20=E7=BB=84=E7=BB=87=E4=B8=8B?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=20app=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/orgs/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/orgs/api.py b/apps/orgs/api.py index 4f72fc792..b241301a8 100644 --- a/apps/orgs/api.py +++ b/apps/orgs/api.py @@ -90,6 +90,11 @@ class OrgMemberRelationBulkViewSet(JMSBulkRelationModelViewSet): filterset_class = OrgMemberRelationFilterSet search_fields = ('user__name', 'user__username', 'org__name') + def get_queryset(self): + queryset = super().get_queryset() + queryset = queryset.exclude(user__role=User.ROLE.APP) + return queryset + def perform_bulk_destroy(self, queryset): objs = list(queryset.all().prefetch_related('user', 'org')) queryset.delete()