[Django] #28927: include tag fails silently if included template's static tag fails

8 views
Skip to first unread message

Django

unread,
Dec 14, 2017, 7:22:12 AM12/14/17
to django-...@googlegroups.com
#28927: include tag fails silently if included template's static tag fails
-----------------------------------------+------------------------
Reporter: sodds | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
This bug happens under the following conditions:
1. Static files storage is ManifestStaticFilesStorage
2. Parent template includes child template with {% include 'child.html' %}
tag
3. Child template uses {% load static %} at the top and uses {% static
'missingfile.css' %}
4. 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

--
Ticket URL: <https://code.djangoproject.com/ticket/28927>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 14, 2017, 7:23:46 AM12/14/17
to django-...@googlegroups.com
#28927: include tag fails silently if included template's static tag fails
-------------------------------+--------------------------------------

Reporter: sodds | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by sodds:

Old description:

> This bug happens under the following conditions:
> 1. Static files storage is ManifestStaticFilesStorage
> 2. Parent template includes child template with {% include 'child.html'
> %} tag
> 3. Child template uses {% load static %} at the top and uses {% static
> 'missingfile.css' %}
> 4. 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

New description:

This bug happens under the following conditions:
1. Static files storage is ManifestStaticFilesStorage

2. Debug setting is False
3. Parent template includes child template with {% include 'child.html' %}
tag
4. Child template uses {% load static %} at the top and uses {% static
'missingfile.css' %}
5. 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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28927#comment:1>

Django

unread,
Dec 14, 2017, 9:32:49 AM12/14/17
to django-...@googlegroups.com
#28927: include tag fails silently if included template's static tag fails
-------------------------------+--------------------------------------
Reporter: sodds | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Simon Charette):

* status: new => closed
* resolution: => duplicate


Comment:

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 using `warnings.simplefilter('error', RemovedInDjango21Warning,
message='^Rendering \{% include ')`

--
Ticket URL: <https://code.djangoproject.com/ticket/28927#comment:2>

Reply all
Reply to author
Forward
0 new messages