Skip to content

Commit 07bd28d

Browse files
committed
fix: update parent containers index on deleting child container
1 parent e9e3a86 commit 07bd28d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

openedx/core/djangoapps/content_libraries/api/containers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ def delete_container(
369369
library_key = container_key.lib_key
370370
container = _get_container_from_key(container_key)
371371

372+
affected_containers = get_containers_contains_item(container_key)
372373
affected_collections = authoring_api.get_entity_collections(
373374
container.publishable_entity.learning_package_id,
374375
container.key,
@@ -395,6 +396,14 @@ def delete_container(
395396
background=True,
396397
)
397398
)
399+
# Send events related to the containers that contains the updated container.
400+
# This is to update the children display names used in the section/subsection previews.
401+
for affected_container in affected_containers:
402+
LIBRARY_CONTAINER_UPDATED.send_event(
403+
library_container=LibraryContainerData(
404+
container_key=affected_container.container_key,
405+
)
406+
)
398407

399408

400409
def restore_container(container_key: LibraryContainerLocator) -> None:

0 commit comments

Comments
 (0)