#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: | UI/UX: |
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)
Changed 8 years ago by
Attachment: | template_error_examples.tar.gz added |
---|
comment:1 Changed 7 years ago by
Owner: | changed from nobody to mariarchi |
---|---|
Status: | new → assigned |
Changed 7 years ago by
Attachment: | patch.diff added |
---|
comment:3 Changed 7 years ago by
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Patch looks good,but needs tests.
comment:4 Changed 7 years ago by
..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.
Changed 7 years ago by
Attachment: | patch.2.diff added |
---|
comment:5 Changed 7 years ago by
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