#22232: Template extends tag can cause recursion ---------------------------------+------------------------------------ Reporter: galedragon | Owner: nobody Type: Bug | Status: new Component: Template system | Version: 1.6 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 1 | UI/UX: 0 ---------------------------------+------------------------------------ Changes (by russellm):
* needs_better_patch: => 0 * needs_tests: => 0 * easy: 0 => 1 * needs_docs: => 0 * type: Cleanup/optimization => Bug * stage: Unreviewed => Accepted Comment: I'd call it a bug; hitting a system level recursion error as a result of accidentally naming the wrong parent in an extends should't be the expected behaviour, if only because it's computationally expensive to hit maximum stack depth. It's definitely an error though - I can't think of any way an internally recursive template could render in a meaningful way. So - yes, this should be caught at the template load level -- a simple "if parent == self, raise error" check should do the trick. -- Ticket URL: <https://code.djangoproject.com/ticket/22232#comment:1> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.474c67d970430616090780272a2c71b5%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.