Skip to content

Commit 7cfbb8c

Browse files
committed
Revert "Remove unnecessary guard"
This reverts commit 8ac0bb5. The admin site somehow adds a RequestContext inside the list; a RequestContext is no ``dict`` and does not have a .items() method.
1 parent 48f59e6 commit 7cfbb8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug_toolbar/panels/templates/panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _store_template_info(self, sender, **kwargs):
8686

8787
context_list = []
8888
for context_layer in context.dicts:
89-
if context_layer:
89+
if hasattr(context_layer, "items") and context_layer:
9090
# Check if the layer is in the cache.
9191
key_values = sorted(context_layer.items())
9292
pformatted = None

0 commit comments

Comments
 (0)