Ticket #16147: 16147.patch
File 16147.patch, 1.1 KB (added by , 13 years ago) |
---|
-
django/template/loader_tags.py
143 143 return output 144 144 145 145 class ConstantIncludeNode(BaseIncludeNode): 146 def __init__(self, template_ path, *args, **kwargs):146 def __init__(self, template_name, *args, **kwargs): 147 147 super(ConstantIncludeNode, self).__init__(*args, **kwargs) 148 self.template_name = template_name 149 150 def render(self, context): 148 151 try: 149 t = get_template(template_path)150 self.template = t152 template = get_template(self.template_name) 153 return self.render_template(template, context) 151 154 except: 152 155 if settings.TEMPLATE_DEBUG: 153 156 raise 154 self.template = None155 156 def render(self, context):157 if not self.template:158 157 return '' 159 return self.render_template(self.template, context)160 158 161 159 class IncludeNode(BaseIncludeNode): 162 160 def __init__(self, template_name, *args, **kwargs):