def get_permissions_queryset(self):
        editable_permissions_queryset = self.get_editable_permissions()
        existing_permissions_queryset = self.object.user_permissions.all()

        return Permission.objects.filter(
            Q(pk__in=editable_permissions_queryset.values('pk')) |
            Q(pk__in=existing_permissions_queryset.values('pk'))
            ).order_by('content_type__app_label').select_related('content_type')
Create a test volume
dataset/ETHPy150Open ofa/connect/open_connect/accounts/views.py/UpdateUserPermissionView.get_permissions_queryset--crossover with--dataset/ETHPy150Open nii-cloud/dodai-compute/nova/tests/test_quota.py/QuotaTestCase._create_volume