#14046 closed (fixed)
Template tag errors masked if including based on context variable name
Reported by: | Philip | Owned by: | mariarchi |
---|---|---|---|
Component: | Template system | Version: | 1.2 |
Severity: | Keywords: | template exception sprintdec2010 | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have a template tag that raises a RuntimeError. Normally, this gets displayed properly to the user, but I have found a case where it doesn't. If I {% include includefilename %} where includefilename is a context variable pointing to a template, then template tag errors are masked. If I do the very same include, but specify the template name directly without using the context variable, things work properly.
I have attached a barebones demo of the problem. To see the demo, runserver and check the template files. You can uncomment my includes in index.html to see the problem.
Attachments (3)
Change History (11)
by , 14 years ago
Attachment: | template_error_examples.tar.gz added |
---|
comment:1 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 14 years ago
Attachment: | patch.diff added |
---|
comment:3 by , 14 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Patch looks good,but needs tests.
comment:4 by , 14 years ago
..and tests would in turn require rewriting a chunk of template tests, because currently they test for things only with "TEMPLATE_DEBUG=False".
I'll try to finish that tomorrow.
by , 14 years ago
Attachment: | patch.2.diff added |
---|
comment:5 by , 14 years ago
Keywords: | sprintdec2010 added |
---|---|
Needs tests: | unset |
Triage Stage: | Accepted → Ready for checkin |
I've seen something similar in my projects before; i'll try to look into it