From 02ee9ae2ccd4b748d98d89864505638683bab82c Mon Sep 17 00:00:00 2001 From: Jawayria Date: Wed, 24 Nov 2021 15:57:43 +0500 Subject: [PATCH] chore: Applied lint-amnesty on cms/djangoapps/contentstore/views --- cms/djangoapps/contentstore/views/assets.py | 10 +++++----- .../contentstore/views/certificates.py | 4 ++-- .../contentstore/views/checklists.py | 2 +- .../contentstore/views/component.py | 4 ++-- cms/djangoapps/contentstore/views/course.py | 16 +++++++-------- .../contentstore/views/entrance_exam.py | 4 ++-- .../contentstore/views/export_git.py | 2 +- .../contentstore/views/import_export.py | 2 +- cms/djangoapps/contentstore/views/item.py | 20 +++++++++---------- cms/djangoapps/contentstore/views/preview.py | 20 +++++++++---------- cms/djangoapps/contentstore/views/public.py | 2 +- .../contentstore/views/transcript_settings.py | 2 +- .../contentstore/views/transcripts_ajax.py | 12 +++++------ cms/djangoapps/contentstore/views/user.py | 2 +- cms/djangoapps/contentstore/views/videos.py | 2 +- 15 files changed, 52 insertions(+), 52 deletions(-) diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index 8af706406d..25fd7b955b 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -24,11 +24,11 @@ from common.djangoapps.util.date_utils import get_default_time_display from common.djangoapps.util.json_request import JsonResponse from openedx.core.djangoapps.contentserver.caching import del_cached_content from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers -from xmodule.contentstore.content import StaticContent -from xmodule.contentstore.django import contentstore -from xmodule.exceptions import NotFoundError -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError +from xmodule.contentstore.content import StaticContent # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.contentstore.django import contentstore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.exceptions import NotFoundError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order from ..exceptions import AssetNotFoundException, AssetSizeTooLargeException from ..utils import reverse_course_url diff --git a/cms/djangoapps/contentstore/views/certificates.py b/cms/djangoapps/contentstore/views/certificates.py index 353e71fe62..6c70419773 100644 --- a/cms/djangoapps/contentstore/views/certificates.py +++ b/cms/djangoapps/contentstore/views/certificates.py @@ -43,8 +43,8 @@ from common.djangoapps.student.auth import has_studio_write_access from common.djangoapps.student.roles import GlobalStaff from common.djangoapps.util.db import MYSQL_MAX_INT, generate_int_id from common.djangoapps.util.json_request import JsonResponse -from xmodule.modulestore import EdxJSONEncoder -from xmodule.modulestore.django import modulestore +from xmodule.modulestore import EdxJSONEncoder # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order from ..exceptions import AssetNotFoundException from ..utils import ( diff --git a/cms/djangoapps/contentstore/views/checklists.py b/cms/djangoapps/contentstore/views/checklists.py index d9a440200a..f8bc809f09 100644 --- a/cms/djangoapps/contentstore/views/checklists.py +++ b/cms/djangoapps/contentstore/views/checklists.py @@ -7,7 +7,7 @@ from opaque_keys.edx.keys import CourseKey from common.djangoapps.edxmako.shortcuts import render_to_response from common.djangoapps.student.auth import has_course_author_access from cms.djangoapps.contentstore.utils import get_proctored_exam_settings_url -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order __all__ = ['checklists_handler'] diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 746db99653..0202a678e4 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -26,8 +26,8 @@ from common.djangoapps.xblock_django.api import authorable_xblocks, disabled_xbl from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag from openedx.core.lib.xblock_utils import get_aside_from_xblock, is_xblock_aside from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order from ..utils import get_lms_link_for_item, get_sibling_urls, reverse_course_url from .helpers import get_parent_xblock, is_unit, xblock_type_display_name diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index b3cd847aec..8e5051bb94 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -73,14 +73,14 @@ from openedx.features.content_type_gating.models import ContentTypeGatingConfig from openedx.features.content_type_gating.partitions import CONTENT_TYPE_GATING_SCHEME from openedx.features.course_experience.waffle import ENABLE_COURSE_ABOUT_SIDEBAR_HTML from openedx.features.course_experience.waffle import waffle as course_experience_waffle -from xmodule.contentstore.content import StaticContent -from xmodule.course_module import CourseBlock, DEFAULT_START_DATE, CourseFields -from xmodule.error_module import ErrorBlock -from xmodule.modulestore import EdxJSONEncoder -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import DuplicateCourseError, ItemNotFoundError -from xmodule.partitions.partitions import UserPartition -from xmodule.tabs import CourseTab, CourseTabList, InvalidTabsException +from xmodule.contentstore.content import StaticContent # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.course_module import CourseBlock, DEFAULT_START_DATE, CourseFields # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.error_module import ErrorBlock # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore import EdxJSONEncoder # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import DuplicateCourseError, ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions import UserPartition # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.tabs import CourseTab, CourseTabList, InvalidTabsException # lint-amnesty, pylint: disable=wrong-import-order from ..course_group_config import ( COHORT_SCHEME, diff --git a/cms/djangoapps/contentstore/views/entrance_exam.py b/cms/djangoapps/contentstore/views/entrance_exam.py index 361a728b41..d47b1274b5 100644 --- a/cms/djangoapps/contentstore/views/entrance_exam.py +++ b/cms/djangoapps/contentstore/views/entrance_exam.py @@ -20,8 +20,8 @@ from common.djangoapps.student.auth import has_course_author_access from common.djangoapps.util import milestones_helpers from openedx.core import toggles as core_toggles from openedx.core.djangolib.js_utils import dump_js_escaped_json -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order from .helpers import create_xblock, remove_entrance_exam_graders from .item import delete_item diff --git a/cms/djangoapps/contentstore/views/export_git.py b/cms/djangoapps/contentstore/views/export_git.py index aec75f37ef..6a32050cd1 100644 --- a/cms/djangoapps/contentstore/views/export_git.py +++ b/cms/djangoapps/contentstore/views/export_git.py @@ -15,7 +15,7 @@ from opaque_keys.edx.keys import CourseKey import cms.djangoapps.contentstore.git_export_utils as git_export_utils from common.djangoapps.edxmako.shortcuts import render_to_response from common.djangoapps.student.auth import has_course_author_access -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order log = logging.getLogger(__name__) diff --git a/cms/djangoapps/contentstore/views/import_export.py b/cms/djangoapps/contentstore/views/import_export.py index fb1328b174..b56d19d595 100644 --- a/cms/djangoapps/contentstore/views/import_export.py +++ b/cms/djangoapps/contentstore/views/import_export.py @@ -37,7 +37,7 @@ from common.djangoapps.student.auth import has_course_author_access from common.djangoapps.util.json_request import JsonResponse from common.djangoapps.util.monitoring import monitor_import_failure from common.djangoapps.util.views import ensure_valid_course_key -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order from ..storage import course_import_export_storage from ..tasks import CourseExportTask, CourseImportTask, export_olx, import_olx diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 800c47456a..16cff22f32 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -43,16 +43,16 @@ from openedx.core.djangoapps.bookmarks import api as bookmarks_api from openedx.core.lib.gating import api as gating_api from openedx.core.lib.xblock_utils import hash_resource, request_token, wrap_xblock, wrap_xblock_aside from openedx.core.toggles import ENTRANCE_EXAMS -from xmodule.course_module 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 -from xmodule.modulestore.exceptions import InvalidLocationError, ItemNotFoundError -from xmodule.modulestore.inheritance import own_metadata -from xmodule.services import ConfigurationService, SettingsService, TeamsConfigurationService -from xmodule.tabs import CourseTabList -from xmodule.x_module import AUTHOR_VIEW, PREVIEW_VIEWS, STUDENT_VIEW, STUDIO_VIEW +from xmodule.course_module import DEFAULT_START_DATE # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.library_tools import LibraryToolsService # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore import EdxJSONEncoder, ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.draft_and_published import DIRECT_ONLY_CATEGORIES # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import InvalidLocationError, ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.inheritance import own_metadata # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.services import ConfigurationService, SettingsService, TeamsConfigurationService # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.tabs import CourseTabList # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.x_module import AUTHOR_VIEW, PREVIEW_VIEWS, STUDENT_VIEW, STUDIO_VIEW # lint-amnesty, pylint: disable=wrong-import-order from ..utils import ( ancestor_has_staff_lock, diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 5689ef558a..5e1beeb5c4 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -31,16 +31,16 @@ from openedx.core.lib.xblock_utils import ( wrap_xblock_aside, xblock_local_resource_url ) -from xmodule.contentstore.django import contentstore -from xmodule.error_module import ErrorBlock -from xmodule.exceptions import NotFoundError, ProcessingError -from xmodule.modulestore.django import ModuleI18nService, modulestore -from xmodule.partitions.partitions_service import PartitionService -from xmodule.services import SettingsService, TeamsConfigurationService -from xmodule.studio_editable import has_author_view -from xmodule.util.sandboxing import can_execute_unsafe_code, get_python_lib_zip -from xmodule.util.xmodule_django import add_webpack_to_fragment -from xmodule.x_module import AUTHOR_VIEW, PREVIEW_VIEWS, STUDENT_VIEW, ModuleSystem, XModule, XModuleDescriptor +from xmodule.contentstore.django import contentstore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.error_module import ErrorBlock # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.exceptions import NotFoundError, ProcessingError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import ModuleI18nService, modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions_service import PartitionService # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.services import SettingsService, TeamsConfigurationService # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.studio_editable import has_author_view # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.util.sandboxing import can_execute_unsafe_code, get_python_lib_zip # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.util.xmodule_django import add_webpack_to_fragment # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.x_module import AUTHOR_VIEW, PREVIEW_VIEWS, STUDENT_VIEW, ModuleSystem, XModule, XModuleDescriptor # lint-amnesty, pylint: disable=wrong-import-order from ..utils import get_visibility_partition_info from .access import get_user_role diff --git a/cms/djangoapps/contentstore/views/public.py b/cms/djangoapps/contentstore/views/public.py index 46799a8f84..4c5cebdb33 100644 --- a/cms/djangoapps/contentstore/views/public.py +++ b/cms/djangoapps/contentstore/views/public.py @@ -5,7 +5,7 @@ Public views from django.conf import settings from django.shortcuts import redirect -from urllib.parse import quote_plus +from urllib.parse import quote_plus # lint-amnesty, pylint: disable=wrong-import-order from waffle.decorators import waffle_switch from common.djangoapps.edxmako.shortcuts import render_to_response diff --git a/cms/djangoapps/contentstore/views/transcript_settings.py b/cms/djangoapps/contentstore/views/transcript_settings.py index 94cc5284d9..6776094042 100644 --- a/cms/djangoapps/contentstore/views/transcript_settings.py +++ b/cms/djangoapps/contentstore/views/transcript_settings.py @@ -27,7 +27,7 @@ from common.djangoapps.util.json_request import JsonResponse, expect_json from openedx.core.djangoapps.video_config.models import VideoTranscriptEnabledFlag from openedx.core.djangoapps.video_pipeline.api import update_3rd_party_transcription_service_credentials from openedx.core.lib.api.view_utils import view_auth_classes -from xmodule.video_module.transcripts_utils import Transcript, TranscriptsGenerationException +from xmodule.video_module.transcripts_utils import Transcript, TranscriptsGenerationException # lint-amnesty, pylint: disable=wrong-import-order from .videos import TranscriptProvider diff --git a/cms/djangoapps/contentstore/views/transcripts_ajax.py b/cms/djangoapps/contentstore/views/transcripts_ajax.py index fe4435d0be..a3b91b6101 100644 --- a/cms/djangoapps/contentstore/views/transcripts_ajax.py +++ b/cms/djangoapps/contentstore/views/transcripts_ajax.py @@ -26,12 +26,12 @@ from opaque_keys.edx.keys import UsageKey from cms.djangoapps.contentstore.views.videos import TranscriptProvider from common.djangoapps.student.auth import has_course_author_access from common.djangoapps.util.json_request import JsonResponse -from xmodule.contentstore.content import StaticContent -from xmodule.contentstore.django import contentstore -from xmodule.exceptions import NotFoundError -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError -from xmodule.video_module.transcripts_utils import ( +from xmodule.contentstore.content import StaticContent # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.contentstore.django import contentstore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.exceptions import NotFoundError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.video_module.transcripts_utils import ( # lint-amnesty, pylint: disable=wrong-import-order GetTranscriptsFromYouTubeException, Transcript, TranscriptsGenerationException, diff --git a/cms/djangoapps/contentstore/views/user.py b/cms/djangoapps/contentstore/views/user.py index 1feb1bfe04..7a0d03687c 100644 --- a/cms/djangoapps/contentstore/views/user.py +++ b/cms/djangoapps/contentstore/views/user.py @@ -18,7 +18,7 @@ from common.djangoapps.student.auth import STUDIO_EDIT_ROLES, STUDIO_VIEW_USERS, from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole, LibraryUserRole from common.djangoapps.util.json_request import JsonResponse, expect_json -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order __all__ = ['request_course_creator', 'course_team_handler'] diff --git a/cms/djangoapps/contentstore/views/videos.py b/cms/djangoapps/contentstore/views/videos.py index ebf839e81b..16ab6e4c7c 100644 --- a/cms/djangoapps/contentstore/views/videos.py +++ b/cms/djangoapps/contentstore/views/videos.py @@ -53,7 +53,7 @@ from openedx.core.djangoapps.video_pipeline.config.waffle import ( ) from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag from openedx.core.lib.api.view_utils import view_auth_classes -from xmodule.video_module.transcripts_utils import Transcript +from xmodule.video_module.transcripts_utils import Transcript # lint-amnesty, pylint: disable=wrong-import-order from ..models import VideoUploadConfig from ..utils import reverse_course_url