Closed foundkey closed 2 months ago
When sending a request using ajax, toolbar.js will send a request at the same time: GET /__debug__/history_sidebar/?store_id=<id> HTTP/1.1
GET /__debug__/history_sidebar/?store_id=<id> HTTP/1.1
This request will throw the following exception when rendering the template:
Traceback (most recent call last): File "/Users/.venv/lib/python3.10/site-packages/django/template/base.py", line 898, in _resolve_lookup raise VariableDoesNotExist( django.template.base.VariableDoesNotExist: Failed lookup for key [toolbar] in [{'True': True, 'False': False, 'None': None}, {'panel': <debug_toolbar.panels.cache.CachePanel object at 0x11f936590>}] [DEBUG] 12/Apr/2024 10:31:22 - Exception while resolving variable 'toolbar' in template 'debug_toolbar/includes/panel_content.html'. Traceback (most recent call last): File "/Users/.venv/lib/python3.10/site-packages/django/template/base.py", line 875, in _resolve_lookup current = current[bit] File "/Users/.venv/lib/python3.10/site-packages/django/template/context.py", line 83, in getitem raise KeyError(key) KeyError: 'toolbar'
This request is handled by this method: history_sidebar(request) It seems because toolbar is not passed in panel_context.
toolbar
panel_context
After turning on Debug level logging, VariableDoesNotExist errors appear frequently during use. But it does not affect the use.
Hmm. I'm softening on my earlier stance on the PR.
When sending a request using ajax, toolbar.js will send a request at the same time:
GET /__debug__/history_sidebar/?store_id=<id> HTTP/1.1
This request will throw the following exception when rendering the template:
This request is handled by this method: history_sidebar(request) It seems because
toolbar
is not passed inpanel_context
.