Code

Ticket #8965: 8965_template_loader_error.diff

File 8965_template_loader_error.diff, 682 bytes (added by Daniel Pope <dan@…>, 6 years ago)

Patch to allow errors from safe_join to propagate

Line 
1Index: django/template/loaders/filesystem.py
2===================================================================
3--- django/template/loaders/filesystem.py       (revision 8985)
4+++ django/template/loaders/filesystem.py       (working copy)
5@@ -10,11 +10,7 @@
6     if not template_dirs:
7         template_dirs = settings.TEMPLATE_DIRS
8     for template_dir in template_dirs:
9-        try:
10-            yield safe_join(template_dir, template_name)
11+        yield safe_join(template_dir, template_name)
12-        except ValueError:
13-            # The joined path was located outside of template_dir.
14-            pass
15 
16 def load_template_source(template_name, template_dirs=None):
17     tried = []