Skip to content

Commit 7b9f956

Browse files
committed
Set the component's parent request explicitly.
1 parent 9836398 commit 7b9f956

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

django_unicorn/views/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ def _process_component_request(
8686
request=request,
8787
)
8888

89-
# This shouldn't happen, but is a fail-safe to make sure that there is always a request on the component
89+
# Make sure that there is always a request on the component if needed
9090
if component.request is None:
9191
component.request = request
9292

93+
# Make sure that there is always a request on the parent if needed
94+
if component.parent is not None and component.parent.request is None:
95+
component.parent.request = request
96+
9397
# Get a deepcopy of the data passed in to determine what fields are updated later
9498
original_data = copy.deepcopy(component_request.data)
9599

0 commit comments

Comments
 (0)