﻿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
18809	MultipleObjectTemplateResponseMixin should handle a generic EmptyQuerySet	benjaoming	nobody	"In get_template_names:

{{{#!python
        if hasattr(self.object_list, 'model'):
            opts = self.object_list.model._meta
            names.append(""%s/%s%s.html"" % (opts.app_label, opts.object_name.lower(), self.template_name_suffix))
}}}


...it should be verified that self.object_list is not None as it apparently may be in some cases where an EmptyQuerySet instance has been generated with no relation to its model class.

On a secondary note, I don't understand why get_template_names is even called when I have defined template_name -- seems like bug?

The work-around is to override get_template_names in your own ListView inheritor:

{{{#!python
    def get_template_names(self):
        # WHY IS THIS CALLED?
        return [self.__class__.template_name]
}}}"	Bug	closed	Generic views	1.4	Normal	invalid			Unreviewed	0	0	0	0	0	0
