mirror of
https://github.com/django-components/django-components.git
synced 2025-08-01 12:42:16 +00:00
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:
parent
ab46ec7d69
commit
be0a75e2a3
5 changed files with 63 additions and 5 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue