﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35337	argument of type 'NoneType' is not iterable, when show facets and change_view is overwritten in ModelAdmin	dz	nobody	"Hello,

{{{
Django==5.0.3
}}}

{{{
@admin.register(LicitacionItem)
class LicitacionItemAdmin(admin.ModelAdmin):

    list_select_related = ('licitacion', 'categoria',
                           'proveedor', 'producto', 'licitacion_detalle')

    raw_id_fields = ('licitacion', 'categoria',
                     'proveedor', 'producto', 'licitacion_detalle')

    search_fields = [""CodigoExterno"", 'search']

    show_facets = admin.ShowFacets.ALLOW

    list_filter = [
        ('licitacion__date', admin.DateFieldListFilter),
        ('licitacion__FechaCierre', admin.DateFieldListFilter),
        'licitacion__CodigoEstado',
        'active',
        'licitacion_detalle__CodigoTipo',
        'licitacion_detalle__Tipo',
        'licitacion_detalle__TipoConvocatoria',
        'licitacion_detalle__CodigoTipo']

    def change_view(self, request, object_id, extra_context=None):
        self.exclude = ('active', 'analizado', 'touch', 'search')
        return super(LicitacionItemAdmin, self).change_view(request, object_id, extra_context)
}}}

when clicking on an item (enter change view), without activating show facets: there are no errors.

when clicking on an item (enter change view), with show facets activated: argument of type 'NoneType' is not iterable (see attached file with the trace)

By completely removing the change_view function, the error does not occur (even if show facets is activated).

Regards


{{{

}}}






"	Uncategorized	new	contrib.admin	5.0	Normal		facets change view	dz	Unreviewed	0	0	0	0	0	0
