Sort imports in cms/
Command: `isort --recursive cms/`
This commit is contained in:
committed by
Kyle McCormick
parent
d21a330d0a
commit
a3deb6e317
@@ -8,14 +8,14 @@ only running cms tests.
|
||||
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import logging
|
||||
import os
|
||||
|
||||
import contracts
|
||||
import pytest
|
||||
|
||||
from openedx.core.pytest_hooks import DeferPlugin
|
||||
|
||||
|
||||
# Patch the xml libs before anything else.
|
||||
from safe_lxml import defuse_xml_libs # isort:skip
|
||||
defuse_xml_libs()
|
||||
|
||||
@@ -5,7 +5,6 @@ URLs for the Studio API app
|
||||
|
||||
from django.conf.urls import include, url
|
||||
|
||||
|
||||
app_name = 'cms.djangoapps.api'
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -12,8 +12,8 @@ from opaque_keys import InvalidKeyError
|
||||
from rest_framework import serializers
|
||||
from rest_framework.fields import empty
|
||||
|
||||
from cms.djangoapps.contentstore.views.course import create_new_course, get_course_and_check_access, rerun_course
|
||||
from cms.djangoapps.contentstore.views.assets import update_course_run_asset
|
||||
from cms.djangoapps.contentstore.views.course import create_new_course, get_course_and_check_access, rerun_course
|
||||
from openedx.core.lib.courses import course_image_url
|
||||
from student.models import CourseAccessRole
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -5,13 +5,12 @@ Receivers of signals sent from django-user-tasks
|
||||
|
||||
import logging
|
||||
|
||||
from django.urls import reverse
|
||||
from django.dispatch import receiver
|
||||
from django.urls import reverse
|
||||
from six.moves.urllib.parse import urljoin
|
||||
from user_tasks.models import UserTaskArtifact
|
||||
from user_tasks.signals import user_task_stopped
|
||||
|
||||
from six.moves.urllib.parse import urljoin
|
||||
|
||||
from .tasks import send_task_complete_email
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -11,8 +11,8 @@ from boto.exception import NoAuthHandlerFound
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.core import mail
|
||||
from django.urls import reverse
|
||||
from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
from rest_framework.test import APITestCase
|
||||
from user_tasks.models import UserTaskArtifact, UserTaskStatus
|
||||
from user_tasks.serializers import ArtifactSerializer, StatusSerializer
|
||||
|
||||
@@ -8,7 +8,7 @@ from openedx.core.djangoapps.waffle_utils import (
|
||||
CourseWaffleFlag,
|
||||
WaffleFlag,
|
||||
WaffleFlagNamespace,
|
||||
WaffleSwitchNamespace,
|
||||
WaffleSwitchNamespace
|
||||
)
|
||||
|
||||
# Namespace
|
||||
|
||||
@@ -5,8 +5,6 @@ import re
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from datetime import timedelta
|
||||
|
||||
from cms.djangoapps.contentstore.course_group_config import GroupConfiguration
|
||||
from course_modes.models import CourseMode
|
||||
from django.conf import settings
|
||||
from django.urls import resolve
|
||||
from django.utils.translation import ugettext as _
|
||||
@@ -14,12 +12,14 @@ from django.utils.translation import ugettext_lazy
|
||||
from eventtracking import tracker
|
||||
from search.search_engine_base import SearchEngine
|
||||
from six import add_metaclass, string_types, text_type
|
||||
|
||||
from cms.djangoapps.contentstore.course_group_config import GroupConfiguration
|
||||
from course_modes.models import CourseMode
|
||||
from openedx.core.lib.courses import course_image_url
|
||||
from xmodule.annotator_mixin import html_to_text
|
||||
from xmodule.library_tools import normalize_key_for_search
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
|
||||
from openedx.core.lib.courses import course_image_url
|
||||
|
||||
# REINDEX_AGE is the default amount of time that we look back for changes
|
||||
# that might have happened. If we are provided with a time at which the
|
||||
# indexing is triggered, then we know it is safe to only index items
|
||||
|
||||
@@ -3,12 +3,11 @@ Unittests for creating a course in an chosen modulestore
|
||||
"""
|
||||
|
||||
|
||||
from six import StringIO
|
||||
|
||||
import ddt
|
||||
import six
|
||||
from django.core.management import CommandError, call_command
|
||||
from django.test import TestCase
|
||||
from six import StringIO
|
||||
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -4,7 +4,6 @@ Unittests for migrating a course to split mongo
|
||||
|
||||
|
||||
import six
|
||||
|
||||
from django.core.management import CommandError, call_command
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from django.core.management import CommandError, call_command
|
||||
import six
|
||||
from django.core.management import CommandError, call_command
|
||||
from six import text_type
|
||||
|
||||
from cms.djangoapps.contentstore.courseware_index import SearchIndexingError
|
||||
|
||||
@@ -18,10 +18,11 @@ from edx_proctoring.api import (
|
||||
)
|
||||
from edx_proctoring.exceptions import ProctoredExamNotFoundException, ProctoredExamReviewPolicyNotFoundException
|
||||
|
||||
from .views.helpers import is_item_in_course_tree
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
|
||||
from .views.helpers import is_item_in_course_tree
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Contentstore API URLs.
|
||||
"""
|
||||
|
||||
from django.urls import include, re_path
|
||||
|
||||
from .v1 import urls as v1_urls
|
||||
|
||||
app_name = 'cms.djangoapps.contentstore'
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
Unit tests for Contentstore views.
|
||||
"""
|
||||
|
||||
from django.urls import reverse
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from django.urls import reverse
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
|
||||
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, InstructorFactory
|
||||
from student.tests.factories import UserFactory
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
from django.urls import re_path
|
||||
|
||||
from . import views
|
||||
from openedx.core.constants import COURSE_ID_PATTERN
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'v1'
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -7,16 +7,16 @@ from rest_framework.exceptions import NotFound
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from common.lib.xmodule.xmodule.course_module import get_available_providers
|
||||
from cms.djangoapps.contentstore.views.course import get_course_and_check_access
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
from common.lib.xmodule.xmodule.course_module import get_available_providers
|
||||
from openedx.core.lib.api.view_utils import view_auth_classes
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
from .serializers import (
|
||||
ProctoredExamConfigurationSerializer,
|
||||
ProctoredExamSettingsSerializer,
|
||||
LimitedProctoredExamSettingsSerializer,
|
||||
ProctoredExamConfigurationSerializer,
|
||||
ProctoredExamSettingsSerializer
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ from datetime import datetime
|
||||
from math import ceil
|
||||
from tempfile import NamedTemporaryFile, mkdtemp
|
||||
|
||||
from ccx_keys.locator import CCXLocator
|
||||
from celery import group
|
||||
from celery.task import task
|
||||
from celery.utils.log import get_task_logger
|
||||
from celery_utils.persist_on_failure import LoggedPersistOnFailureTask
|
||||
from ccx_keys.locator import CCXLocator
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import User
|
||||
@@ -36,7 +36,11 @@ from six.moves import range
|
||||
from user_tasks.models import UserTaskArtifact, UserTaskStatus
|
||||
from user_tasks.tasks import UserTask
|
||||
|
||||
from cms.djangoapps.contentstore.courseware_index import CoursewareSearchIndexer, LibrarySearchIndexer, SearchIndexingError
|
||||
from cms.djangoapps.contentstore.courseware_index import (
|
||||
CoursewareSearchIndexer,
|
||||
LibrarySearchIndexer,
|
||||
SearchIndexingError
|
||||
)
|
||||
from cms.djangoapps.contentstore.storage import course_import_export_storage
|
||||
from cms.djangoapps.contentstore.utils import initialize_permissions, reverse_usage_url, translation_language
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
|
||||
@@ -21,11 +21,15 @@ from mock import Mock, patch
|
||||
from pytz import UTC
|
||||
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_usage_url
|
||||
from course_modes.models import CourseMode
|
||||
from cms.djangoapps.models.settings.course_grading import GRADING_POLICY_CHANGED_EVENT_TYPE, CourseGradingModel, hash_grading_policy
|
||||
from cms.djangoapps.models.settings.course_grading import (
|
||||
GRADING_POLICY_CHANGED_EVENT_TYPE,
|
||||
CourseGradingModel,
|
||||
hash_grading_policy
|
||||
)
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
from cms.djangoapps.models.settings.encoder import CourseSettingsEncoder
|
||||
from cms.djangoapps.models.settings.waffle import MATERIAL_RECOMPUTE_ONLY_FLAG
|
||||
from course_modes.models import CourseMode
|
||||
from openedx.core.djangoapps.models.course_details import CourseDetails
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from student.roles import CourseInstructorRole, CourseStaffRole
|
||||
|
||||
@@ -56,7 +56,6 @@ from xmodule.partitions.partitions import UserPartition
|
||||
from xmodule.tests import DATA_DIR
|
||||
from xmodule.x_module import XModuleMixin
|
||||
|
||||
|
||||
COURSE_CHILD_STRUCTURE = {
|
||||
"course": "chapter",
|
||||
"chapter": "sequential",
|
||||
|
||||
@@ -19,8 +19,8 @@ from six import text_type
|
||||
|
||||
from openedx.core.djangoapps.django_comment_common.models import assign_default_role
|
||||
from openedx.core.djangoapps.django_comment_common.utils import seed_permissions_roles
|
||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
|
||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
|
||||
from openedx.features.content_type_gating.partitions import CONTENT_TYPE_GATING_SCHEME
|
||||
from student import auth
|
||||
|
||||
@@ -19,7 +19,6 @@ from opaque_keys.edx.keys import AssetKey, CourseKey
|
||||
from pymongo import ASCENDING, DESCENDING
|
||||
from six import text_type
|
||||
|
||||
from .exception import AssetNotFoundException, AssetSizeTooLargeException
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from openedx.core.djangoapps.contentserver.caching import del_cached_content
|
||||
from student.auth import has_course_author_access
|
||||
@@ -32,6 +31,7 @@ from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
|
||||
from ..utils import reverse_course_url
|
||||
from .exception import AssetNotFoundException, AssetSizeTooLargeException
|
||||
|
||||
__all__ = ['assets_handler']
|
||||
|
||||
|
||||
@@ -39,13 +39,6 @@ from opaque_keys import InvalidKeyError
|
||||
from opaque_keys.edx.keys import AssetKey, CourseKey
|
||||
from six import text_type
|
||||
|
||||
from ..utils import (
|
||||
get_lms_link_for_certificate_web_view,
|
||||
reverse_course_url,
|
||||
get_proctored_exam_settings_url
|
||||
)
|
||||
from .assets import delete_asset
|
||||
from .exception import AssetNotFoundException
|
||||
from course_modes.models import CourseMode
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from student.auth import has_studio_write_access
|
||||
@@ -55,6 +48,10 @@ from util.json_request import JsonResponse
|
||||
from xmodule.modulestore import EdxJSONEncoder
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
from ..utils import get_lms_link_for_certificate_web_view, get_proctored_exam_settings_url, reverse_course_url
|
||||
from .assets import delete_asset
|
||||
from .exception import AssetNotFoundException
|
||||
|
||||
CERTIFICATE_SCHEMA_VERSION = 1
|
||||
CERTIFICATE_MINIMUM_ID = 100
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@ from xblock.exceptions import NoSuchHandlerError
|
||||
from xblock.plugin import PluginMissingError
|
||||
from xblock.runtime import Mixologist
|
||||
|
||||
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
|
||||
from .item import StudioEditModuleRuntime, add_container_page_publishing_info, create_xblock_info
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from openedx.core.lib.xblock_utils import get_aside_from_xblock, is_xblock_aside
|
||||
from student.auth import has_course_author_access
|
||||
@@ -32,6 +29,10 @@ from xblock_django.models import XBlockStudioConfigurationFlag
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
|
||||
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
|
||||
from .item import StudioEditModuleRuntime, add_container_page_publishing_info, create_xblock_info
|
||||
|
||||
__all__ = [
|
||||
'container_handler',
|
||||
'component_handler'
|
||||
|
||||
@@ -30,36 +30,14 @@ from opaque_keys.edx.locator import BlockUsageLocator
|
||||
from six import text_type
|
||||
from six.moves import filter
|
||||
|
||||
from ..course_group_config import (
|
||||
COHORT_SCHEME,
|
||||
ENROLLMENT_SCHEME,
|
||||
RANDOM_SCHEME,
|
||||
GroupConfiguration,
|
||||
GroupConfigurationsValidationError
|
||||
)
|
||||
from ..course_info_model import delete_course_update, get_course_updates, update_course_updates
|
||||
from ..courseware_index import CoursewareSearchIndexer, SearchIndexingError
|
||||
from ..tasks import rerun_course as rerun_course_task
|
||||
from ..utils import (
|
||||
add_instructor,
|
||||
get_lms_link_for_item,
|
||||
get_proctored_exam_settings_url,
|
||||
initialize_permissions,
|
||||
remove_all_instructors,
|
||||
reverse_course_url,
|
||||
reverse_library_url,
|
||||
reverse_url,
|
||||
reverse_usage_url
|
||||
)
|
||||
from .entrance_exam import create_entrance_exam, delete_entrance_exam, update_entrance_exam
|
||||
from course_action_state.managers import CourseActionStateItemNotFoundError
|
||||
from course_action_state.models import CourseRerunState, CourseRerunUIStateManager
|
||||
from cms.djangoapps.course_creators.views import add_user_with_status_unrequested, get_course_creator_status
|
||||
from course_modes.models import CourseMode
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
from cms.djangoapps.models.settings.encoder import CourseSettingsEncoder
|
||||
from course_action_state.managers import CourseActionStateItemNotFoundError
|
||||
from course_action_state.models import CourseRerunState, CourseRerunUIStateManager
|
||||
from course_modes.models import CourseMode
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
|
||||
from openedx.core.djangoapps.credit.api import get_credit_requirements, is_credit_course
|
||||
from openedx.core.djangoapps.credit.tasks import update_credit_course_requirements
|
||||
@@ -98,13 +76,35 @@ from xmodule.modulestore.exceptions import DuplicateCourseError, ItemNotFoundErr
|
||||
from xmodule.partitions.partitions import UserPartition
|
||||
from xmodule.tabs import CourseTab, CourseTabList, InvalidTabsException
|
||||
|
||||
from ..course_group_config import (
|
||||
COHORT_SCHEME,
|
||||
ENROLLMENT_SCHEME,
|
||||
RANDOM_SCHEME,
|
||||
GroupConfiguration,
|
||||
GroupConfigurationsValidationError
|
||||
)
|
||||
from ..course_info_model import delete_course_update, get_course_updates, update_course_updates
|
||||
from ..courseware_index import CoursewareSearchIndexer, SearchIndexingError
|
||||
from ..tasks import rerun_course as rerun_course_task
|
||||
from ..utils import (
|
||||
add_instructor,
|
||||
get_lms_link_for_item,
|
||||
get_proctored_exam_settings_url,
|
||||
initialize_permissions,
|
||||
remove_all_instructors,
|
||||
reverse_course_url,
|
||||
reverse_library_url,
|
||||
reverse_url,
|
||||
reverse_usage_url
|
||||
)
|
||||
from .component import ADVANCED_COMPONENT_TYPES
|
||||
from .entrance_exam import create_entrance_exam, delete_entrance_exam, update_entrance_exam
|
||||
from .item import create_xblock_info
|
||||
from .library import (
|
||||
LIBRARY_AUTHORING_MICROFRONTEND_URL,
|
||||
LIBRARIES_ENABLED,
|
||||
LIBRARY_AUTHORING_MICROFRONTEND_URL,
|
||||
get_library_creator_status,
|
||||
should_redirect_to_library_authoring_mfe,
|
||||
should_redirect_to_library_authoring_mfe
|
||||
)
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -16,8 +16,6 @@ from django.views.decorators.csrf import ensure_csrf_cookie
|
||||
from opaque_keys import InvalidKeyError
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey
|
||||
|
||||
from .helpers import create_xblock, remove_entrance_exam_graders
|
||||
from .item import delete_item
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
from openedx.core.djangolib.js_utils import dump_js_escaped_json
|
||||
from student.auth import has_course_author_access
|
||||
@@ -25,6 +23,9 @@ from util import milestones_helpers
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
|
||||
from .helpers import create_xblock, remove_entrance_exam_graders
|
||||
from .item import delete_item
|
||||
|
||||
__all__ = ['entrance_exam', ]
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -3,23 +3,24 @@ Helper methods for Studio views.
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import six
|
||||
from uuid import uuid4
|
||||
|
||||
import six
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
from opaque_keys.edx.keys import UsageKey
|
||||
from xblock.core import XBlock
|
||||
|
||||
from ..utils import reverse_course_url, reverse_library_url, reverse_usage_url
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from util.milestones_helpers import is_entrance_exams_enabled
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.tabs import StaticTab
|
||||
from xmodule.x_module import DEPRECATION_VSCOMPAT_EVENT
|
||||
|
||||
from ..utils import reverse_course_url, reverse_library_url, reverse_usage_url
|
||||
|
||||
__all__ = ['event']
|
||||
|
||||
# Note: Grader types are used throughout the platform but most usages are simply in-line
|
||||
|
||||
@@ -30,15 +30,16 @@ from storages.backends.s3boto import S3BotoStorage
|
||||
from user_tasks.conf import settings as user_tasks_settings
|
||||
from user_tasks.models import UserTaskArtifact, UserTaskStatus
|
||||
|
||||
from ..storage import course_import_export_storage
|
||||
from ..tasks import CourseExportTask, CourseImportTask, export_olx, import_olx
|
||||
from ..utils import reverse_course_url, reverse_library_url
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from student.auth import has_course_author_access
|
||||
from util.json_request import JsonResponse
|
||||
from util.views import ensure_valid_course_key
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
from ..storage import course_import_export_storage
|
||||
from ..tasks import CourseExportTask, CourseImportTask, export_olx, import_olx
|
||||
from ..utils import reverse_course_url, reverse_library_url
|
||||
|
||||
__all__ = [
|
||||
'import_handler', 'import_status_handler',
|
||||
'export_handler', 'export_output_handler', 'export_status_handler',
|
||||
|
||||
@@ -31,7 +31,31 @@ from xblock.core import XBlock
|
||||
from xblock.fields import Scope
|
||||
|
||||
from cms.djangoapps.contentstore.config.waffle import SHOW_REVIEW_RULES_FLAG
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from cms.djangoapps.xblock_config.models import CourseEditLTIFieldsEnabledFlag
|
||||
from cms.lib.xblock.authoring_mixin import VISIBILITY_VIEW
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleSwitch
|
||||
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 static_replace import replace_static_urls
|
||||
from student.auth import has_studio_read_access, has_studio_write_access
|
||||
from util.date_utils import get_default_time_display
|
||||
from util.json_request import JsonResponse, expect_json
|
||||
from util.milestones_helpers import is_entrance_exams_enabled
|
||||
from xblock_django.user_service import DjangoXBlockUserService
|
||||
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 ..utils import (
|
||||
ancestor_has_staff_lock,
|
||||
find_release_date_source,
|
||||
@@ -53,29 +77,6 @@ from .helpers import (
|
||||
xblock_type_display_name
|
||||
)
|
||||
from .preview import get_preview_fragment
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleSwitch
|
||||
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 static_replace import replace_static_urls
|
||||
from student.auth import has_studio_read_access, has_studio_write_access
|
||||
from util.date_utils import get_default_time_display
|
||||
from util.json_request import JsonResponse, expect_json
|
||||
from util.milestones_helpers import is_entrance_exams_enabled
|
||||
from cms.djangoapps.xblock_config.models import CourseEditLTIFieldsEnabledFlag
|
||||
from xblock_django.user_service import DjangoXBlockUserService
|
||||
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
|
||||
|
||||
__all__ = [
|
||||
'orphan_handler', 'xblock_handler', 'xblock_view_handler', 'xblock_outline_handler', 'xblock_container_handler'
|
||||
|
||||
@@ -19,8 +19,6 @@ from opaque_keys.edx.keys import CourseKey
|
||||
from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator
|
||||
from six import text_type
|
||||
|
||||
from ..utils import add_instructor, reverse_library_url
|
||||
from .item import create_xblock_info
|
||||
from cms.djangoapps.course_creators.views import get_course_creator_status
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from student.auth import (
|
||||
@@ -37,8 +35,9 @@ from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import DuplicateCourseError
|
||||
|
||||
from ..config.waffle import REDIRECT_TO_LIBRARY_AUTHORING_MICROFRONTEND
|
||||
|
||||
from ..utils import add_instructor, reverse_library_url
|
||||
from .component import CONTAINER_TEMPLATES, get_component_templates
|
||||
from .item import create_xblock_info
|
||||
from .user import user_with_role
|
||||
|
||||
__all__ = ['library_handler', 'manage_library_users']
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
import logging
|
||||
from functools import partial
|
||||
import six
|
||||
|
||||
import six
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.urls import reverse
|
||||
from django.http import Http404, HttpResponseBadRequest
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
from opaque_keys.edx.keys import UsageKey
|
||||
@@ -17,9 +17,8 @@ from xblock.exceptions import NoSuchHandlerError
|
||||
from xblock.runtime import KvsFieldData
|
||||
|
||||
import static_replace
|
||||
from cms.djangoapps.xblock_config.models import StudioConfig
|
||||
from cms.lib.xblock.field_data import CmsFieldData
|
||||
from ..utils import get_visibility_partition_info
|
||||
from .access import get_user_role
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
|
||||
from openedx.core.lib.license import wrap_with_license
|
||||
@@ -31,8 +30,6 @@ from openedx.core.lib.xblock_utils import (
|
||||
wrap_xblock_aside,
|
||||
xblock_local_resource_url
|
||||
)
|
||||
from xmodule.util.sandboxing import can_execute_unsafe_code, get_python_lib_zip
|
||||
from cms.djangoapps.xblock_config.models import StudioConfig
|
||||
from xblock_django.user_service import DjangoXBlockUserService
|
||||
from xmodule.contentstore.django import contentstore
|
||||
from xmodule.error_module import ErrorDescriptor
|
||||
@@ -41,9 +38,12 @@ from xmodule.modulestore.django import ModuleI18nService, modulestore
|
||||
from xmodule.partitions.partitions_service import PartitionService
|
||||
from xmodule.services import SettingsService
|
||||
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 ..utils import get_visibility_partition_info
|
||||
from .access import get_user_role
|
||||
from .helpers import render_from_lms
|
||||
from .session_kv_store import SessionKeyValueStore
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@ from django.shortcuts import redirect
|
||||
from django.utils.http import urlquote_plus
|
||||
from waffle.decorators import waffle_switch
|
||||
|
||||
from ..config import waffle
|
||||
from edxmako.shortcuts import render_to_response
|
||||
|
||||
from ..config import waffle
|
||||
|
||||
__all__ = ['register_redirect_to_lms', 'login_redirect_to_lms', 'howitworks', 'accessibility']
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ from django.contrib.auth.models import User
|
||||
from django.test import TestCase
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
|
||||
from ..access import get_user_role
|
||||
from student.auth import add_users
|
||||
from student.roles import CourseInstructorRole, CourseStaffRole
|
||||
from student.tests.factories import AdminFactory
|
||||
|
||||
from ..access import get_user_role
|
||||
|
||||
|
||||
class RolesTest(TestCase):
|
||||
"""
|
||||
|
||||
@@ -18,7 +18,6 @@ from six.moves import range
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import get_lms_link_for_certificate_web_view, reverse_course_url
|
||||
from ..certificates import CERTIFICATE_SCHEMA_VERSION, CertificateManager
|
||||
from course_modes.tests.factories import CourseModeFactory
|
||||
from student.models import CourseEnrollment
|
||||
from student.roles import CourseInstructorRole, CourseStaffRole
|
||||
@@ -28,6 +27,8 @@ from xmodule.contentstore.content import StaticContent
|
||||
from xmodule.contentstore.django import contentstore
|
||||
from xmodule.exceptions import NotFoundError
|
||||
|
||||
from ..certificates import CERTIFICATE_SCHEMA_VERSION, CertificateManager
|
||||
|
||||
FEATURES_WITH_CERTS_ENABLED = settings.FEATURES.copy()
|
||||
FEATURES_WITH_CERTS_ENABLED['CERTIFICATES_HTML_VIEW'] = True
|
||||
|
||||
|
||||
@@ -15,11 +15,12 @@ from pytz import UTC
|
||||
|
||||
import cms.djangoapps.contentstore.views.component as views
|
||||
from cms.djangoapps.contentstore.tests.test_libraries import LibraryTestCase
|
||||
from .utils import StudioPageTestCase
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
|
||||
from .utils import StudioPageTestCase
|
||||
|
||||
|
||||
class ContainerPageTestCase(StudioPageTestCase, LibraryTestCase):
|
||||
"""
|
||||
|
||||
@@ -23,13 +23,6 @@ from cms.djangoapps.contentstore.config.waffle import WAFFLE_NAMESPACE as STUDIO
|
||||
from cms.djangoapps.contentstore.courseware_index import CoursewareSearchIndexer, SearchIndexingError
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import add_instructor, reverse_course_url, reverse_usage_url
|
||||
from ..course import WAFFLE_NAMESPACE as COURSE_WAFFLE_NAMESPACE
|
||||
from ..course import (
|
||||
_deprecated_blocks_info,
|
||||
course_outline_initial_state,
|
||||
reindex_course_and_check_access
|
||||
)
|
||||
from ..item import VisibilityState, create_xblock_info
|
||||
from course_action_state.managers import CourseRerunUIStateManager
|
||||
from course_action_state.models import CourseRerunState
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace
|
||||
@@ -40,6 +33,10 @@ from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, LibraryFactory, check_mongo_calls
|
||||
|
||||
from ..course import WAFFLE_NAMESPACE as COURSE_WAFFLE_NAMESPACE
|
||||
from ..course import _deprecated_blocks_info, course_outline_initial_state, reindex_course_and_check_access
|
||||
from ..item import VisibilityState, create_xblock_info
|
||||
|
||||
|
||||
class TestCourseIndex(CourseTestCase):
|
||||
"""
|
||||
|
||||
@@ -15,6 +15,12 @@ from opaque_keys.edx.keys import UsageKey
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_url
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
from student.tests.factories import UserFactory
|
||||
from util import milestones_helpers
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
from ..entrance_exam import (
|
||||
add_entrance_exam_milestone,
|
||||
create_entrance_exam,
|
||||
@@ -23,11 +29,6 @@ from ..entrance_exam import (
|
||||
update_entrance_exam
|
||||
)
|
||||
from ..helpers import GRADER_TYPES, create_xblock
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
|
||||
from student.tests.factories import UserFactory
|
||||
from util import milestones_helpers
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
|
||||
@patch.dict(settings.FEATURES, {'ENTRANCE_EXAMS': True})
|
||||
|
||||
@@ -6,7 +6,6 @@ Exam Settings View Tests
|
||||
|
||||
import ddt
|
||||
import lxml
|
||||
|
||||
from django.conf import settings
|
||||
from django.test.utils import override_settings
|
||||
|
||||
|
||||
@@ -11,11 +11,12 @@ from mock import patch
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_usage_url
|
||||
from ..item import VisibilityState
|
||||
from openedx.core.lib.gating.api import GATING_NAMESPACE_QUALIFIER
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE
|
||||
from xmodule.modulestore.tests.factories import ItemFactory
|
||||
|
||||
from ..item import VisibilityState
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class TestSubsectionGating(CourseTestCase):
|
||||
|
||||
@@ -13,7 +13,11 @@ import six
|
||||
from mock import patch
|
||||
from six.moves import range
|
||||
|
||||
from cms.djangoapps.contentstore.course_group_config import CONTENT_GROUP_CONFIGURATION_NAME, ENROLLMENT_SCHEME, GroupConfiguration
|
||||
from cms.djangoapps.contentstore.course_group_config import (
|
||||
CONTENT_GROUP_CONFIGURATION_NAME,
|
||||
ENROLLMENT_SCHEME,
|
||||
GroupConfiguration
|
||||
)
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_usage_url
|
||||
from openedx.features.content_type_gating.helpers import CONTENT_GATING_PARTITION_ID
|
||||
|
||||
@@ -7,9 +7,10 @@ import six
|
||||
from django.utils import http
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from ..helpers import xblock_studio_url, xblock_type_display_name
|
||||
from xmodule.modulestore.tests.factories import ItemFactory, LibraryFactory
|
||||
|
||||
from ..helpers import xblock_studio_url, xblock_type_display_name
|
||||
|
||||
|
||||
class HelpersTestCase(CourseTestCase):
|
||||
"""
|
||||
|
||||
@@ -34,17 +34,6 @@ from xblock.validation import ValidationMessage
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_usage_url
|
||||
from cms.djangoapps.contentstore.views import item as item_module
|
||||
from ..component import component_handler, get_component_templates
|
||||
from ..item import (
|
||||
ALWAYS,
|
||||
VisibilityState,
|
||||
_get_module_info,
|
||||
_get_source_index,
|
||||
_xblock_type_and_display_name,
|
||||
add_container_page_publishing_info,
|
||||
create_xblock_info,
|
||||
highlights_setting
|
||||
)
|
||||
from lms_xblock.mixin import NONSENSICAL_ACCESS_RESTRICTION
|
||||
from student.tests.factories import UserFactory
|
||||
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag
|
||||
@@ -65,6 +54,18 @@ from xmodule.partitions.partitions import (
|
||||
from xmodule.partitions.tests.test_partitions import MockPartitionService
|
||||
from xmodule.x_module import STUDENT_VIEW, STUDIO_VIEW
|
||||
|
||||
from ..component import component_handler, get_component_templates
|
||||
from ..item import (
|
||||
ALWAYS,
|
||||
VisibilityState,
|
||||
_get_module_info,
|
||||
_get_source_index,
|
||||
_xblock_type_and_display_name,
|
||||
add_container_page_publishing_info,
|
||||
create_xblock_info,
|
||||
highlights_setting
|
||||
)
|
||||
|
||||
|
||||
class AsideTest(XBlockAside):
|
||||
"""
|
||||
|
||||
@@ -16,12 +16,13 @@ from six.moves import range
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase, parse_json
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_library_url
|
||||
from ..component import get_component_templates
|
||||
from ..library import get_library_creator_status
|
||||
from cms.djangoapps.course_creators.views import add_user_with_status_granted as grant_course_creator_status
|
||||
from student.roles import LibraryUserRole
|
||||
from xmodule.modulestore.tests.factories import LibraryFactory
|
||||
|
||||
from ..component import get_component_templates
|
||||
from ..library import get_library_creator_status
|
||||
|
||||
LIBRARY_REST_URL = '/library/' # URL for GET/POST requests involving libraries
|
||||
|
||||
|
||||
|
||||
@@ -12,15 +12,16 @@ from django.test.client import Client, RequestFactory
|
||||
from xblock.core import XBlock, XBlockAside
|
||||
|
||||
from cms.djangoapps.contentstore.utils import reverse_usage_url
|
||||
from ..preview import _preview_module_system, get_preview_fragment
|
||||
from student.tests.factories import UserFactory
|
||||
from cms.djangoapps.xblock_config.models import StudioConfig
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.test_asides import AsideTestType
|
||||
|
||||
from ..preview import _preview_module_system, get_preview_fragment
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class GetPreviewHtmlTestCase(ModuleStoreTestCase):
|
||||
|
||||
@@ -6,6 +6,7 @@ from unittest import TestCase
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url
|
||||
|
||||
from ..course import TextbookValidationError, validate_textbook_json, validate_textbooks_json
|
||||
|
||||
|
||||
|
||||
@@ -13,10 +13,11 @@ from mock import ANY, Mock, patch
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url
|
||||
from ..transcript_settings import TranscriptionProviderErrorType, validate_transcript_credentials
|
||||
from openedx.core.djangoapps.profile_images.tests.helpers import make_image_file
|
||||
from student.roles import CourseStaffRole
|
||||
|
||||
from ..transcript_settings import TranscriptionProviderErrorType, validate_transcript_credentials
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@patch(
|
||||
|
||||
@@ -3,11 +3,12 @@ Unit tests for the unit page.
|
||||
"""
|
||||
|
||||
|
||||
from .utils import StudioPageTestCase
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.factories import ItemFactory
|
||||
from xmodule.x_module import STUDENT_VIEW
|
||||
|
||||
from .utils import StudioPageTestCase
|
||||
|
||||
|
||||
class UnitPageTestCase(StudioPageTestCase):
|
||||
"""
|
||||
|
||||
@@ -33,6 +33,17 @@ from waffle.testutils import override_flag
|
||||
from cms.djangoapps.contentstore.models import VideoUploadConfig
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url
|
||||
from openedx.core.djangoapps.profile_images.tests.helpers import make_image_file
|
||||
from openedx.core.djangoapps.video_pipeline.config.waffle import (
|
||||
DEPRECATE_YOUTUBE,
|
||||
ENABLE_DEVSTACK_VIDEO_UPLOADS,
|
||||
waffle_flags
|
||||
)
|
||||
from openedx.core.djangoapps.video_pipeline.models import VEMPipelineIntegration
|
||||
from openedx.core.djangoapps.waffle_utils.models import WaffleFlagCourseOverrideModel
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
from ..videos import (
|
||||
ENABLE_VIDEO_UPLOAD_PAGINATION,
|
||||
KEY_EXPIRATION_IN_SECONDS,
|
||||
@@ -44,16 +55,6 @@ from ..videos import (
|
||||
_get_default_video_image_url,
|
||||
convert_video_status
|
||||
)
|
||||
from openedx.core.djangoapps.profile_images.tests.helpers import make_image_file
|
||||
from openedx.core.djangoapps.video_pipeline.config.waffle import (
|
||||
DEPRECATE_YOUTUBE,
|
||||
ENABLE_DEVSTACK_VIDEO_UPLOADS,
|
||||
waffle_flags
|
||||
)
|
||||
from openedx.core.djangoapps.video_pipeline.models import VEMPipelineIntegration
|
||||
from openedx.core.djangoapps.waffle_utils.models import WaffleFlagCourseOverrideModel
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
|
||||
def override_switch(switch, active):
|
||||
|
||||
@@ -6,9 +6,10 @@ Utilities for view tests.
|
||||
import json
|
||||
|
||||
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
||||
from ..helpers import xblock_studio_url
|
||||
from xmodule.modulestore.tests.factories import ItemFactory
|
||||
|
||||
from ..helpers import xblock_studio_url
|
||||
|
||||
|
||||
class StudioPageTestCase(CourseTestCase):
|
||||
"""
|
||||
|
||||
@@ -11,9 +11,6 @@ from django.core.files.base import ContentFile
|
||||
from django.http import HttpResponse, HttpResponseNotFound
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.http import require_GET, require_http_methods, require_POST
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
|
||||
from .videos import TranscriptProvider
|
||||
from edxval.api import (
|
||||
create_or_update_video_transcript,
|
||||
delete_video_transcript,
|
||||
@@ -22,12 +19,16 @@ from edxval.api import (
|
||||
get_video_transcript_data,
|
||||
update_transcript_credentials_state_for_org
|
||||
)
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
|
||||
from openedx.core.djangoapps.video_config.models import VideoTranscriptEnabledFlag
|
||||
from openedx.core.djangoapps.video_pipeline.api import update_3rd_party_transcription_service_credentials
|
||||
from student.auth import has_studio_write_access
|
||||
from util.json_request import JsonResponse, expect_json
|
||||
from xmodule.video_module.transcripts_utils import Transcript, TranscriptsGenerationException
|
||||
|
||||
from .videos import TranscriptProvider
|
||||
|
||||
__all__ = [
|
||||
'transcript_credentials_handler',
|
||||
'transcript_download_handler',
|
||||
|
||||
@@ -5,11 +5,11 @@ Views related to the video upload feature
|
||||
|
||||
import codecs
|
||||
import csv
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
from contextlib import closing
|
||||
from datetime import datetime, timedelta
|
||||
import io
|
||||
from uuid import uuid4
|
||||
|
||||
import six
|
||||
@@ -41,9 +41,6 @@ from edxval.api import (
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from pytz import UTC
|
||||
|
||||
from ..models import VideoUploadConfig
|
||||
from ..utils import reverse_course_url
|
||||
from ..video_utils import validate_video_image
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from openedx.core.djangoapps.video_config.models import VideoTranscriptEnabledFlag
|
||||
from openedx.core.djangoapps.video_pipeline.config.waffle import (
|
||||
@@ -55,6 +52,9 @@ from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNam
|
||||
from util.json_request import JsonResponse, expect_json
|
||||
from xmodule.video_module.transcripts_utils import Transcript
|
||||
|
||||
from ..models import VideoUploadConfig
|
||||
from ..utils import reverse_course_url
|
||||
from ..video_utils import validate_video_image
|
||||
from .course import get_course_and_check_access
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -11,7 +11,12 @@ from django.contrib import admin
|
||||
from django.core.mail import send_mail
|
||||
from django.dispatch import receiver
|
||||
|
||||
from cms.djangoapps.course_creators.models import CourseCreator, send_admin_notification, send_user_notification, update_creator_state
|
||||
from cms.djangoapps.course_creators.models import (
|
||||
CourseCreator,
|
||||
send_admin_notification,
|
||||
send_user_notification,
|
||||
update_creator_state
|
||||
)
|
||||
from cms.djangoapps.course_creators.views import update_course_creator_group
|
||||
from edxmako.shortcuts import render_to_string
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ import six
|
||||
from eventtracking import tracker
|
||||
|
||||
from cms.djangoapps.contentstore.signals.signals import GRADING_POLICY_CHANGED
|
||||
from cms.djangoapps.models.settings.waffle import material_recompute_only
|
||||
from track.event_transaction_utils import create_new_event_transaction_id
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from cms.djangoapps.models.settings.waffle import material_recompute_only
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -4,18 +4,19 @@ Django module for Course Metadata class -- manages advanced settings and related
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import pytz
|
||||
import six
|
||||
from crum import get_current_user
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import ugettext as _
|
||||
import pytz
|
||||
from six import text_type
|
||||
from xblock.fields import Scope
|
||||
|
||||
from openedx.core.lib.teams_config import TeamsetType
|
||||
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
|
||||
from student.roles import GlobalStaff
|
||||
from openedx.core.lib.teams_config import TeamsetType
|
||||
from xblock_django.models import XBlockStudioConfigurationFlag
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ Togglable settings for Course Grading behavior
|
||||
"""
|
||||
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag
|
||||
|
||||
|
||||
WAFFLE_NAMESPACE = 'grades'
|
||||
|
||||
# edx/edx-platform feature
|
||||
|
||||
@@ -7,8 +7,8 @@ import logging
|
||||
|
||||
from django import forms
|
||||
|
||||
from openedx.core.lib.courses import clean_course_id
|
||||
from cms.djangoapps.xblock_config.models import CourseEditLTIFieldsEnabledFlag
|
||||
from openedx.core.lib.courses import clean_course_id
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ Tests for the Studio Tagging XBlockAside
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
from six import StringIO
|
||||
|
||||
import ddt
|
||||
import six
|
||||
@@ -13,17 +12,18 @@ from django.test.client import RequestFactory
|
||||
from lxml import etree
|
||||
from opaque_keys.edx.asides import AsideUsageKeyV1, AsideUsageKeyV2
|
||||
from pytz import UTC
|
||||
from six import StringIO
|
||||
from xblock.fields import ScopeIds
|
||||
from xblock.runtime import DictKeyValueStore, KvsFieldData
|
||||
from xblock.test.tools import TestRuntime
|
||||
|
||||
from cms.lib.xblock.tagging import StructuredTagsAside
|
||||
from cms.lib.xblock.tagging.models import TagAvailableValues, TagCategories
|
||||
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient
|
||||
from cms.djangoapps.contentstore.utils import reverse_usage_url
|
||||
from cms.djangoapps.contentstore.views.preview import get_preview_fragment
|
||||
from student.tests.factories import UserFactory
|
||||
from cms.djangoapps.xblock_config.models import StudioConfig
|
||||
from cms.lib.xblock.tagging import StructuredTagsAside
|
||||
from cms.lib.xblock.tagging.models import TagAvailableValues, TagCategories
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
@@ -10,15 +10,14 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from edx_api_doc_tools import make_docs_urls
|
||||
from ratelimitbackend import admin
|
||||
|
||||
from cms.djangoapps.contentstore import views as contentstore_views
|
||||
import openedx.core.djangoapps.common_views.xblock
|
||||
import openedx.core.djangoapps.debug.views
|
||||
import openedx.core.djangoapps.lang_pref.views
|
||||
from cms.djangoapps.contentstore import views as contentstore_views
|
||||
from cms.djangoapps.contentstore.views.organization import OrganizationListView
|
||||
from openedx.core.apidocs import api_info
|
||||
from openedx.core.djangoapps.password_policy import compliance as password_policy_compliance
|
||||
from openedx.core.djangoapps.password_policy.forms import PasswordPolicyAwareAdminAuthForm
|
||||
from openedx.core.apidocs import api_info
|
||||
|
||||
|
||||
django_autodiscover()
|
||||
admin.site.site_header = _('Studio Administration')
|
||||
|
||||
Reference in New Issue
Block a user