mirror of
https://github.com/django-components/django-components.git
synced 2025-09-11 00:16:17 +00:00
* Add regression test for recursion bug, #68 * Only allow slots to access slot nodelists provided to their immediate parent component to prevent infinite recursions. * Fix import ordering bug in test * Add slot.super to docs Remove unused imports * Bump version Co-authored-by: rbeard0330 <@dul2k3BKW6m>
This commit is contained in:
parent
7f4661922a
commit
e3c9ac76ce
6 changed files with 74 additions and 13 deletions
|
@ -114,8 +114,7 @@ class Component(metaclass=SimplifiedInterfaceMediaDefiningClass):
|
|||
def render(self, context):
|
||||
template_name = self.template(context)
|
||||
instance_template = self.get_processed_template(template_name)
|
||||
active_slots = {**context.get(ACTIVE_SLOT_CONTEXT_KEY, {}), **self.slots}
|
||||
with context.update({ACTIVE_SLOT_CONTEXT_KEY: active_slots}):
|
||||
with context.update({ACTIVE_SLOT_CONTEXT_KEY: self.slots}):
|
||||
return instance_template.render(context)
|
||||
|
||||
class Media:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue