Skip to content

Commit

Permalink
This is an outstanding snippet and I'd vote for it to be included int…
Browse files Browse the repository at this point in the history
…o 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.
  • Loading branch information
chadselph authored and clokep committed May 18, 2016
1 parent b273838 commit 51e0baa
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 51e0baa

Please sign in to comment.