From ee1b6b8a6d199d0ecc88a0758d0e161becac3143 Mon Sep 17 00:00:00 2001 From: Yusuf Musleh Date: Wed, 13 Sep 2023 22:22:55 +0300 Subject: [PATCH] fix: Copy/Paste unit with python_lib.zip (#33164) This fixes the issue when pasting a copied unit that contains python_lib.zip file into another course. The python_lib.zip file was not being correctly copied over to the new course's Files & Uploads page. --- openedx/core/lib/xblock_serializer/block_serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/lib/xblock_serializer/block_serializer.py b/openedx/core/lib/xblock_serializer/block_serializer.py index 84736a7762..0fd3510058 100644 --- a/openedx/core/lib/xblock_serializer/block_serializer.py +++ b/openedx/core/lib/xblock_serializer/block_serializer.py @@ -38,7 +38,7 @@ class XBlockSerializer: if path not in [sf.name for sf in self.static_files]: self.static_files.append(StaticFile(name=path, url=asset['url'], data=None)) - if block.scope_ids.usage_id.block_type == 'problem': + if block.scope_ids.usage_id.block_type in ['problem', 'vertical']: py_lib_zip_file = utils.get_python_lib_zip_if_using(self.olx_str, course_key) if py_lib_zip_file: self.static_files.append(py_lib_zip_file)