Missing context variables and kwargs in component_block (#17)

* Fix issue with missing variables by binding template to context in Component.render method.
* Pass extra_context to Component.render()

Co-authored-by: rbeard0330 <@dul2k3BKW6m>
This commit is contained in:
rbeard0330 2020-12-14 12:25:36 -05:00 committed by GitHub
parent ab46ec7d69
commit be0a75e2a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 5 deletions

View file

@ -85,7 +85,9 @@ class Component(with_metaclass(MediaDefiningClass)):
else:
nodelist.append(node)
return nodelist.render(Context(context))
render_context = Context(context)
with render_context.bind_template(template.template):
return nodelist.render(render_context)
return template.render(context)