Ticket #17199: #17199-template_loader_origin.diff
File #17199-template_loader_origin.diff, 1.5 KB (added by , 13 years ago) |
---|
-
django/template/loader.py
46 46 origin = make_origin(display_name, self.load_template_source, template_name, template_dirs) 47 47 try: 48 48 template = get_template_from_string(source, origin, template_name) 49 return template, None49 return template, origin and origin.name 50 50 except TemplateDoesNotExist: 51 51 # If compiling the template we found raises TemplateDoesNotExist, back off to 52 52 # returning the source and display name for the template we were asked to load. -
django/template/loaders/cached.py
50 50 # back off to returning the source and display name for the template 51 51 # we were asked to load. This allows for correct identification (later) 52 52 # of the actual template that does not exist. 53 return template, origin 54 self.template_cache[key] = template55 return self.template_cache[key] , None53 return template, origin and origin.name 54 self.template_cache[key] = (template, origin and origin.name) 55 return self.template_cache[key] 56 56 57 57 def reset(self): 58 58 "Empty the template cache."