mirror of https://github.com/jumpserver/jumpserver
fix: Default 组织下出现 app user
parent
7d5a13de38
commit
6b5435b768
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue