Opened 10 years ago

Last modified 8 years ago

#24577 new Bug

Restrict extending and including to require templates from the same engine.

Reported by: Preston Timmons Owned by: nobody
Component: Template system Version: dev
Severity: Normal Keywords:
Cc: desecho@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no
Pull Requests:How to create a pull request

Description

If two Django engines are configured and a template object from the first engine is used as an include or extends in a template from the second engine, it's not clear which engine will be used if the template object also happens to include or extend other templates.

Per discussion with Aymeric, it sounds like the least ambiguous behavior it to raise an exception if an included or extended template has a different engine than that of the current template.

This affects the IncludeNode, ExtendsNode, and InclusionNode.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

Change History (4)

comment:1 by Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Anton Samarchyan, 8 years ago

Cc: desecho@… added

I can't reproduce this issue. Can you offer a sample project?

comment:3 by Tim Graham, 8 years ago

A start at solving this for {% include %} is attached to the ticket.

Last edited 8 years ago by Tim Graham (previous) (diff)

by Tim Graham, 8 years ago

Attachment: 24577.diff added
Note: See TracTickets for help on using tickets.
Back to Top