refactor: fix context vars missing in isolated slot (#455)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Juro Oravec 2024-04-25 12:08:20 +02:00 committed by GitHub
parent e4e787b29d
commit ae22eff8af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 94 additions and 11 deletions

View file

@ -263,7 +263,7 @@ class Component(View, metaclass=SimplifiedInterfaceMediaDefiningClass):
# NOTE: This if/else is important to avoid nested Contexts,
# See https://github.com/EmilStenstrom/django-components/issues/414
context = context_data if isinstance(context_data, Context) else Context(context_data)
prepare_context(context, outer_context=self.outer_context or Context())
prepare_context(context, self.outer_context or Context(), component_id=self.component_id)
template = self.get_template(context)
# Associate the slots with this component for this context