From b4a4c96059b341d9835a996ecf1e9b388e8d9323 Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Sat, 25 Nov 2023 01:20:52 -0300 Subject: [PATCH] style: pylint fixes --- cms/djangoapps/contentstore/utils.py | 7 ++++++- .../contentstore/xblock_storage_handlers/view_handlers.py | 1 - xmodule/library_content_block.py | 1 - xmodule/util/duplicate.py | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 4a3003d9615b..f03e3daa7a36 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -1059,7 +1059,12 @@ def duplicate_block( if not children_handled: handle_children_duplication( - dest_block, store, source_item, store, user, duplication_function=duplicate_block, shallow=shallow + dest_block, + source_item, + store, + user, + duplication_function=duplicate_block, + shallow=shallow, ) # pylint: disable=protected-access diff --git a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py index 2896318ec7a5..b796c5e646c4 100644 --- a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py +++ b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py @@ -54,7 +54,6 @@ from openedx.core.lib.cache_utils import request_cached from openedx.core.toggles import ENTRANCE_EXAMS from xmodule.course_block import DEFAULT_START_DATE -from xmodule.library_tools import LibraryToolsService from xmodule.modulestore import EdxJSONEncoder, ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.draft_and_published import DIRECT_ONLY_CATEGORIES diff --git a/xmodule/library_content_block.py b/xmodule/library_content_block.py index a40656f58695..eb9e6ba695c9 100644 --- a/xmodule/library_content_block.py +++ b/xmodule/library_content_block.py @@ -8,7 +8,6 @@ import random from copy import copy from gettext import ngettext, gettext -from typing import Callable import bleach from django.conf import settings diff --git a/xmodule/util/duplicate.py b/xmodule/util/duplicate.py index 249a44044344..dbbbdf7f6531 100644 --- a/xmodule/util/duplicate.py +++ b/xmodule/util/duplicate.py @@ -1,9 +1,13 @@ +""" +Utility to aid xblock duplication +""" from typing import Callable def handle_children_duplication( xblock, source_item, store, user, duplication_function: Callable[..., None], shallow: bool ): + """Implements default behaviour to handle children duplication.""" if not source_item.has_children or shallow: return