#31478: Template.get_exception_info relies on internal state which isn't correct
for sub-templates.
---------------------------------+--------------------------------------
Reporter: Keryn Knight | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: master
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
---------------------------------+--------------------------------------
Comment (by Keryn Knight):
Example project is here: https://github.com/kezabelle/django-ticket-31478
The 2 dependencies are Django and the app with which I encountered the
problem, which is itself a terrible set of monkeypatches upon the Django
Template Language. There's probably cleaner ways to demonstrate the issue,
but this is the quickest one I obviously have at hand. As far as I know
it's not specifically the monkeypatch at fault, but I could be wrong.
Steps to hopefully reproduce:
- clone repo
- install requirements in root of repo (`pip install -r requirements.txt`)
- boot runserver.
- navigate your browser to `/fine` with DEBUG turned on, so the technical
500 renders. You should hopefully observe that the template's HTML is
shown, and the error is ''highlighted correctly'' as `{{ force_error }}`
- navigate to `/problem` to see the error being described in the ticket
proper. You should hopefully observe that the HTML shown is that of the
`base.html` template rather than the `subtemplate.html` which **extends**
`base.html` - as a result, ''the HTML is wrong, there is no line to
highlight, and it reports the error at line 0''.
With the proposed possible changes, the error is highlighted correctly on
`/problem`, the line is reported as line 4 correctly, and the path to the
template shown is the correct subtemplate rather than the base one.
--
Ticket URL: <https://code.djangoproject.com/ticket/31478#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.339c3d8db3f60eac7d908e1d96325b2d%40djangoproject.com.