9999 ComponentLinksSerializer ,
100100 PublishableEntityLinksSummarySerializer ,
101101)
102- from cms .djangoapps .contentstore .xblock_storage_handlers .view_handlers import sync_library_content
102+ from cms .djangoapps .contentstore .xblock_storage_handlers .view_handlers import (
103+ sync_library_content ,
104+ get_upstream ,
105+ )
103106from cms .lib .xblock .upstream_sync import (
104107 BadDownstream ,
105108 BadUpstream ,
110113 decline_sync ,
111114 sever_upstream_link ,
112115)
116+ from cms .lib .xblock .container_upstream_sync import decline_sync_container
113117from common .djangoapps .student .auth import has_studio_read_access , has_studio_write_access
114118from openedx .core .lib .api .view_utils import (
115119 DeveloperErrorViewMixin ,
@@ -330,7 +334,7 @@ def post(self, request: _AuthenticatedRequest, usage_key_string: str) -> Respons
330334 raise ValidationError (detail = str (exc )) from exc
331335 # Note: We call `get_for_block` (rather than `try_get_for_block`) because if anything is wrong with the
332336 # upstream at this point, then that is completely unexpected, so it's appropriate to let the 500 happen.
333- response = UpstreamLink . get_for_block (downstream ). to_json ( )
337+ response = get_upstream (downstream )
334338 response ["static_file_notices" ] = attrs_asdict (static_file_notices )
335339 return Response (response )
336340
@@ -340,7 +344,10 @@ def delete(self, request: _AuthenticatedRequest, usage_key_string: str) -> Respo
340344 """
341345 downstream = _load_accessible_block (request .user , usage_key_string , require_write_access = True )
342346 try :
343- decline_sync (downstream )
347+ if downstream .usage_key .block_type == 'vertical' :
348+ decline_sync_container (downstream )
349+ else :
350+ decline_sync (downstream )
344351 except (NoUpstream , BadUpstream , BadDownstream ) as exc :
345352 # This is somewhat unexpected. If the upstream link is missing or invalid, then the downstream author
346353 # shouldn't have been prompted to accept/decline a sync in the first place. Of course, they could have just
0 commit comments