Ticket #16147: 16147.patch

File 16147.patch, 1.1 KB (added by Aymeric Augustin, 13 years ago)
  • django/template/loader_tags.py

     
    143143        return output
    144144
    145145class ConstantIncludeNode(BaseIncludeNode):
    146     def __init__(self, template_path, *args, **kwargs):
     146    def __init__(self, template_name, *args, **kwargs):
    147147        super(ConstantIncludeNode, self).__init__(*args, **kwargs)
     148        self.template_name = template_name
     149
     150    def render(self, context):
    148151        try:
    149             t = get_template(template_path)
    150             self.template = t
     152            template = get_template(self.template_name)
     153            return self.render_template(template, context)
    151154        except:
    152155            if settings.TEMPLATE_DEBUG:
    153156                raise
    154             self.template = None
    155 
    156     def render(self, context):
    157         if not self.template:
    158157            return ''
    159         return self.render_template(self.template, context)
    160158
    161159class IncludeNode(BaseIncludeNode):
    162160    def __init__(self, template_name, *args, **kwargs):
Back to Top