diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index d354d012dd3f..885e7848f04f 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -1051,12 +1051,11 @@ def duplicate_block( ) children_handled = False - if hasattr(dest_block, "studio_post_duplicate"): - # Allow an XBlock to do anything fancy it may need to when duplicated from another block. - load_services_for_studio(source_item.runtime, user) - children_handled = dest_block.studio_post_duplicate( - store, source_item, store, user, duplication_function=duplicate_block, shallow=shallow - ) + # Allow an XBlock to do anything fancy it may need to when duplicated from another block. + load_services_for_studio(source_item.runtime, user) + children_handled = dest_block.studio_post_duplicate( + store, source_item, store, user, duplication_function=duplicate_block, shallow=shallow + ) if not children_handled: handle_children_duplication( diff --git a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py index 10b2c85adcff..2896318ec7a5 100644 --- a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py +++ b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py @@ -818,12 +818,11 @@ def _duplicate_block( ) children_handled = False - if hasattr(dest_block, "studio_post_duplicate"): - # Allow an XBlock to do anything fancy it may need to when duplicated from another block. - load_services_for_studio(source_item.runtime, user) - children_handled = dest_block.studio_post_duplicate( - source_item, store, user, duplication_function=_duplicate_block, shallow=False - ) + # Allow an XBlock to do anything fancy it may need to when duplicated from another block. + load_services_for_studio(source_item.runtime, user) + children_handled = dest_block.studio_post_duplicate( + source_item, store, user, duplication_function=_duplicate_block, shallow=False + ) if not children_handled: handle_children_duplication( diff --git a/cms/envs/common.py b/cms/envs/common.py index 11afd870a016..7525e5974a81 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -959,6 +959,7 @@ # Import after sys.path fixup from xmodule.modulestore.inheritance import InheritanceMixin from xmodule.x_module import XModuleMixin +from xmodule.studio_editable import StudioEditableBlock # These are the Mixins that should be added to every XBlock. # This should be moved into an XBlock Runtime/Application object @@ -969,6 +970,7 @@ XModuleMixin, EditInfoMixin, AuthoringMixin, + StudioEditableBlock, ) XBLOCK_EXTRA_MIXINS = ()