def formfield_for_manytomany(self, db_field, request=None, **kwargs):
        if db_field.name == 'permissions':
            qs = kwargs.get('queryset', db_field.rel.to.objects)
            if qs:
                qs = self._simplify_permissions(qs)
            kwargs['queryset'] = qs
        return super().formfield_for_manytomany(
            db_field, request=request, **kwargs
        )
dataset/ETHPy150Open allegro/ralph/src/ralph/accounts/admin.py/RalphGroupAdmin.formfield_for_manytomany/original