#18853: get_template_names() does not consider the queryset-only case -------------------------------+-------------------- Reporter: msopacua | Owner: nobody Type: Uncategorized | Status: new Component: Generic views | Version: master Severity: Normal | Keywords: CBV Triage Stage: Unreviewed | Has patch: 1 Easy pickings: 1 | UI/UX: 0 -------------------------------+-------------------- In SingleObjectTemplateResponseMixin candidate names are generated using the model name. This model name is derived either from self.object or self.model but does not consider self.queryset. In the case of "create forms", self.object is unset and if self.model is not provided either, an exception is thrown much later by the template loader in select_template. This exception does not point to this method as it successfully returns an (empty) list. The test suite kind of contains a test for this (generic_views/edit.py:test_create_without_redirect), but the problem is that the test posts data to the form and does not actually request the form. In the practical case this form could never have been submitted as it wouldn't be rendered. Patch attached fixes the issue and creates a test.
-- Ticket URL: <https://code.djangoproject.com/ticket/18853> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.