File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
debug_toolbar/panels/templates Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,18 @@ def template_source(request):
2727 template_name = request .GET .get ("template" , template_origin_name )
2828
2929 final_loaders = []
30- loaders = Engine .get_default ().template_loaders
30+ loaders = list (Engine .get_default ().template_loaders )
31+
32+ while loaders :
33+ loader = loaders .pop (0 )
3134
32- for loader in loaders :
3335 if loader is not None :
34- # When the loader has loaders associated with it,
35- # append those loaders to the list. This occurs with
36- # django.template.loaders.cached.Loader
36+ # Recursively unwrap loaders until we get to loaders which do not
37+ # themselves wrap other loaders. This occurs
38+ # with django.template.loaders.cached.Loader and the
39+ # django-template-partials loader (possibly among others)
3740 if hasattr (loader , "loaders" ):
38- final_loaders += loader .loaders
41+ loaders . extend ( loader .loaders )
3942 else :
4043 final_loaders .append (loader )
4144
You can’t perform that action at this time.
0 commit comments