mirror of
https://github.com/django-components/django-components.git
synced 2025-09-27 07:59:08 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
bfd55f9fbe
commit
16065367d5
1 changed files with 8 additions and 7 deletions
|
@ -206,7 +206,6 @@ class ComponentNode(Node):
|
||||||
self.component, self.isolated_context = component, isolated_context
|
self.component, self.isolated_context = component, isolated_context
|
||||||
self.slots = slots
|
self.slots = slots
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<Component Node: %s. Contents: %r>" % (
|
return "<Component Node: %s. Contents: %r>" % (
|
||||||
self.component,
|
self.component,
|
||||||
|
@ -216,7 +215,9 @@ class ComponentNode(Node):
|
||||||
def render(self, context):
|
def render(self, context):
|
||||||
if type(self.component) == str:
|
if type(self.component) == str:
|
||||||
try:
|
try:
|
||||||
component_name = template.Variable(self.component).resolve(context)
|
component_name = template.Variable(self.component).resolve(
|
||||||
|
context
|
||||||
|
)
|
||||||
component_class = registry.get(component_name)
|
component_class = registry.get(component_name)
|
||||||
self.component = component_class(component_name)
|
self.component = component_class(component_name)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue