Opened 7 years ago
Closed 7 years ago
#28927 closed Uncategorized (duplicate)
include tag fails silently if included template's static tag fails
Reported by: | sodds | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
This bug happens under the following conditions:
- Static files storage is ManifestStaticFilesStorage
- Debug setting is False
- Parent template includes child template with {% include 'child.html' %} tag
- Child template uses {% load static %} at the top and uses {% static 'missingfile.css' %}
- Referenced static file does not exists (or is missing from .json manifest)
The actual result is that the parent template renders fine but the child template does not get included
The expected result is an error, e.g. a status code 500
Change History (2)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Since 1.11 Django already raises a warning when an exception occurs during
{% include %}
and plan to elevate it to an exception in 2.1 so I'm going to close this as duplicate of #27175 which introduced this change.In the mean time you can either make sure you enable Python warnings and assert none is raised during your test suite execution or force this particular instance of
RemovedInDjango21Warning
to be converted to an exception usingwarnings.simplefilter('error', RemovedInDjango21Warning, message='^Rendering \{% include ')