|
17 | 17 |
|
18 | 18 | DJANGO_BIRD_BUILTINS = "django_bird.templatetags.django_bird" |
19 | 19 | DJANGO_BIRD_FINDER = "django_bird.staticfiles.BirdAssetFinder" |
20 | | -DJANGO_BIRD_LOADER = "django_bird.loader.BirdLoader" |
21 | 20 |
|
22 | 21 |
|
23 | 22 | @dataclass |
@@ -70,33 +69,13 @@ def configure_templates(self) -> None: |
70 | 69 |
|
71 | 70 | options = template_config.setdefault("OPTIONS", {}) |
72 | 71 |
|
73 | | - self.configure_loaders(options) |
74 | 72 | self.configure_builtins(options) |
75 | 73 |
|
76 | 74 | # Force re-evaluation of settings.TEMPLATES because EngineHandler caches it. |
77 | 75 | with suppress(AttributeError): |
78 | 76 | del django.template.engines.templates |
79 | 77 | django.template.engines._engines = {} # type: ignore[attr-defined] |
80 | 78 |
|
81 | | - def configure_loaders(self, options: dict[str, Any]) -> None: |
82 | | - loaders = options.setdefault("loaders", []) |
83 | | - |
84 | | - # find the inner-most loaders, which is an iterable of only strings |
85 | | - while not all(isinstance(loader, str) for loader in loaders): |
86 | | - for loader in loaders: |
87 | | - # if we've found a list or tuple, we aren't yet in the inner-most loaders |
88 | | - if isinstance(loader, list | tuple): |
89 | | - # reassign `loaders` variable to force the while loop restart |
90 | | - loaders = loader |
91 | | - |
92 | | - # if django-bird's loader is the first, we good |
93 | | - loaders_already_configured = ( |
94 | | - len(loaders) > 0 and DJANGO_BIRD_LOADER == loaders[0] |
95 | | - ) |
96 | | - |
97 | | - if not loaders_already_configured: |
98 | | - loaders.insert(0, DJANGO_BIRD_LOADER) |
99 | | - |
100 | 79 | def configure_builtins(self, options: dict[str, Any]) -> None: |
101 | 80 | builtins = options.setdefault("builtins", []) |
102 | 81 |
|
|
0 commit comments