From 51e0baa866e434ce092af0d5a2aa3e775c81cdcd Mon Sep 17 00:00:00 2001 From: chadselph Date: Fri, 27 Aug 2010 23:21:54 -0400 Subject: [PATCH] This is an outstanding snippet and I'd vote for it to be included into core, but there's a pointless .render() on line 47, presumably left over from debugging. This is actually a bug because if the entire template requires a variable and the block does not, render_block_to_string will fail without that unnecessary variable. --- template.py | 1 - 1 file changed, 1 deletion(-) diff --git a/template.py b/template.py index 3895b7d..aeb8407 100644 --- a/template.py +++ b/template.py @@ -44,7 +44,6 @@ def render_block_to_string(template_name, block, dictionary=None, context_instan context_instance.update(dictionary) else: context_instance = Context(dictionary) - t.render(context_instance) return render_template_block(t, block, context_instance) def direct_block_to_template(request, template, block, extra_context=None, mimetype=None, **kwargs):