Fix rendering extension CSS/JS bundles on modern Django.
Review Request #10785 — Created Nov. 4, 2019 and discarded — Latest diff uploaded
When rendering CSS/JS bundles for extensions in a developer setup (with
PIPELINE_ENABLED=False), the resulting HTML would be escaped, causing
garbage on the page and preventing the bundles from loading. This was
due to the lack of amark_safe()when rendering source files within
Pipeline (as that's normally handled later in their standard template
tag process), and the modern behavior to automatically escape unless
explicitly marked safe.This simply adds a
mark_safe()around the resulting HTML, and
introduces new unit tests to check for these conditions.
Unit tests pass.
No longer saw escaped HTML for bundles on the page.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.
| djblets/extensions/templatetags/djblets_extensions.py |
|---|
| djblets/extensions/tests/test_templatetags.py |
|---|
| djblets/extensions/tests/static/css/default.css |
|---|
| djblets/extensions/tests/static/css/optional.css |
|---|
| djblets/extensions/tests/static/js/default.js |
|---|
| djblets/extensions/tests/static/js/optional.js |
|---|
| tests/settings.py |
|---|