Use full names for common.djangoapps imports; warn when using old style (#25477)

* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
This commit is contained in:
Kyle McCormick
2020-11-10 07:02:01 -05:00
committed by GitHub
parent a62c5dad49
commit 151bd13666
1707 changed files with 6132 additions and 2430 deletions

View File

@@ -5,10 +5,10 @@ ANALYTICS_DASHBOARD_NAME: Your Platform Name Here Insights
ANALYTICS_DASHBOARD_URL: http://localhost:18110/courses
AUTH_PASSWORD_VALIDATORS:
- NAME: django.contrib.auth.password_validation.UserAttributeSimilarityValidator
- NAME: util.password_policy_validators.MinimumLengthValidator
- NAME: common.djangoapps.util.password_policy_validators.MinimumLengthValidator
OPTIONS:
min_length: 2
- NAME: util.password_policy_validators.MaximumLengthValidator
- NAME: common.djangoapps.util.password_policy_validators.MaximumLengthValidator
OPTIONS:
max_length: 75
AWS_ACCESS_KEY_ID: null
@@ -34,47 +34,47 @@ BULK_EMAIL_LOG_SENT_EMAILS: false
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: celery
LOCATION:
- edx.devstack.memcached:11211
TIMEOUT: '7200'
configuration:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: 1001c6274ca4
LOCATION:
- edx.devstack.memcached:11211
course_structure_cache:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: course_structure
LOCATION:
- edx.devstack.memcached:11211
TIMEOUT: '7200'
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: default
LOCATION:
- edx.devstack.memcached:11211
VERSION: '1'
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: general
LOCATION:
- edx.devstack.memcached:11211
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: mongo_metadata_inheritance
LOCATION:
- edx.devstack.memcached:11211
TIMEOUT: 300
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: 1001c6274ca4_general
LOCATION:
- edx.devstack.memcached:11211

View File

@@ -15,7 +15,7 @@ from rest_framework.fields import empty
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 common.djangoapps.student.models import CourseAccessRole
from xmodule.modulestore.django import modulestore
IMAGE_TYPES = {

View File

@@ -8,8 +8,8 @@ import pytz
from django.test import RequestFactory
from openedx.core.lib.courses import course_image_url
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import UserFactory
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

View File

@@ -13,9 +13,9 @@ from opaque_keys.edx.keys import CourseKey
from rest_framework.test import APIClient
from openedx.core.lib.courses import course_image_url
from student.models import CourseAccessRole
from student.tests.factories import TEST_PASSWORD, AdminFactory, UserFactory
from util.organizations_helpers import add_organization, get_course_organizations
from common.djangoapps.student.models import CourseAccessRole
from common.djangoapps.student.tests.factories import TEST_PASSWORD, AdminFactory, UserFactory
from common.djangoapps.util.organizations_helpers import add_organization, get_course_organizations
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError

View File

@@ -10,7 +10,7 @@ from celery.utils.log import get_task_logger
from django.conf import settings
from django.core import mail
from edxmako.shortcuts import render_to_string
from common.djangoapps.edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
LOGGER = get_task_logger(__name__)

View File

@@ -7,7 +7,7 @@ from django.urls import reverse
from rest_framework.test import APITestCase
from lms.djangoapps.courseware.tests.factories import StaffFactory
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory

View File

@@ -14,7 +14,7 @@ from rest_framework.test import APITestCase
from user_tasks.models import UserTaskStatus
from lms.djangoapps.courseware.tests.factories import StaffFactory
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

View File

@@ -10,7 +10,7 @@ from rest_framework import status
from rest_framework.test import APITestCase
from lms.djangoapps.courseware.tests.factories import StaffFactory
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory

View File

@@ -12,7 +12,7 @@ from rest_framework.generics import GenericAPIView
from openedx.core.djangoapps.util.forms import to_bool
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes
from openedx.core.lib.cache_utils import request_cached
from student.auth import has_course_author_access
from common.djangoapps.student.auth import has_course_author_access
from xmodule.modulestore.django import modulestore

View File

@@ -12,7 +12,7 @@ from django.utils.translation import ugettext as _
from cms.djangoapps.contentstore.utils import reverse_usage_url
from lms.lib.utils import get_parent_unit
from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_user_partition
from util.db import MYSQL_MAX_INT, generate_int_id
from common.djangoapps.util.db import MYSQL_MAX_INT, generate_int_id
from xmodule.partitions.partitions import MINIMUM_STATIC_PARTITION_ID, ReadOnlyUserPartitionError, UserPartition
from xmodule.partitions.partitions_service import get_all_partitions_for_course
from xmodule.split_test_module import get_split_user_partitions

View File

@@ -14,7 +14,7 @@ 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 common.djangoapps.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

View File

@@ -6,8 +6,8 @@ Delete course tests.
import mock
from django.core.management import CommandError, call_command
from student.roles import CourseInstructorRole
from student.tests.factories import UserFactory
from common.djangoapps.student.roles import CourseInstructorRole
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.modulestore.django import modulestore

View File

@@ -9,7 +9,7 @@ from testfixtures import LogCapture
from cms.djangoapps.contentstore.views.course import create_new_course_in_store
from openedx.core.djangoapps.catalog.tests.factories import CourseRunFactory
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -9,7 +9,7 @@ from rest_framework import status
from rest_framework.test import APITestCase
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, InstructorFactory
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

View File

@@ -15,8 +15,8 @@ from cms.djangoapps.contentstore.proctoring import register_special_exams
from lms.djangoapps.grades.api import task_compute_all_grades_for_course
from openedx.core.djangoapps.credit.signals import on_course_publish
from openedx.core.lib.gating import api as gating_api
from track.event_transaction_utils import get_event_transaction_id, get_event_transaction_type
from util.module_utils import yield_dynamic_descriptor_descendants
from common.djangoapps.track.event_transaction_utils import get_event_transaction_id, get_event_transaction_type
from common.djangoapps.util.module_utils import yield_dynamic_descriptor_descendants
from xmodule.modulestore.django import SignalHandler, modulestore
from .signals import GRADING_POLICY_CHANGED

View File

@@ -39,11 +39,11 @@ from cms.djangoapps.contentstore.courseware_index import (
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
from course_action_state.models import CourseRerunState
from common.djangoapps.course_action_state.models import CourseRerunState
from openedx.core.djangoapps.embargo.models import CountryAccessRule, RestrictedCourse
from openedx.core.lib.extract_tar import safetar_extractall
from student.auth import has_course_author_access
from util.organizations_helpers import add_organization_course, get_organization_by_short_name
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.util.organizations_helpers import add_organization_course, get_organization_by_short_name
from xmodule.contentstore.django import contentstore
from xmodule.course_module import CourseFields
from xmodule.exceptions import SerializationError

View File

@@ -12,9 +12,9 @@ from opaque_keys.edx.locator import CourseLocator
from cms.djangoapps.contentstore.tasks import rerun_course
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from course_action_state.managers import CourseRerunUIStateManager
from course_action_state.models import CourseRerunState
from student.auth import has_course_author_access
from common.djangoapps.course_action_state.managers import CourseRerunUIStateManager
from common.djangoapps.course_action_state.models import CourseRerunState
from common.djangoapps.student.auth import has_course_author_access
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.modulestore import EdxJSONEncoder, ModuleStoreEnum

View File

@@ -34,13 +34,13 @@ from cms.djangoapps.contentstore.config import waffle
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase, get_url, parse_json
from cms.djangoapps.contentstore.utils import delete_course, reverse_course_url, reverse_url
from cms.djangoapps.contentstore.views.component import ADVANCED_COMPONENT_TYPES
from course_action_state.managers import CourseActionStateItemNotFoundError
from course_action_state.models import CourseRerunState, CourseRerunUIStateManager
from common.djangoapps.course_action_state.managers import CourseActionStateItemNotFoundError
from common.djangoapps.course_action_state.models import CourseRerunState, CourseRerunUIStateManager
from openedx.core.djangoapps.django_comment_common.utils import are_permissions_roles_seeded
from openedx.core.lib.tempdir import mkdtemp_clean
from student import auth
from student.models import CourseEnrollment
from student.roles import CourseCreatorRole, CourseInstructorRole
from common.djangoapps.student import auth
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.roles import CourseCreatorRole, CourseInstructorRole
from xmodule.capa_module import ProblemBlock
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore

View File

@@ -13,9 +13,9 @@ from mock import patch
from opaque_keys.edx.keys import CourseKey
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient, parse_json
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import UserFactory
from util.organizations_helpers import add_organization, get_course_organizations
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util.organizations_helpers import add_organization, get_course_organizations
from xmodule.course_module import CourseFields
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore

View File

@@ -23,8 +23,8 @@ from cms.djangoapps.contentstore.views.course import (
_accessible_courses_summary_iter,
get_courses_accessible_to_user
)
from course_action_state.models import CourseRerunState
from student.roles import (
from common.djangoapps.course_action_state.models import CourseRerunState
from common.djangoapps.student.roles import (
CourseInstructorRole,
CourseStaffRole,
GlobalStaff,
@@ -32,7 +32,7 @@ from student.roles import (
OrgStaffRole,
UserBasedRole
)
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.course_module import CourseSummary
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -30,12 +30,12 @@ from cms.djangoapps.models.settings.course_grading import (
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 common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.models.course_details import CourseDetails
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import UserFactory
from util import milestones_helpers
from xblock_django.models import XBlockStudioConfigurationFlag
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util import milestones_helpers
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.fields import Date
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
@@ -514,7 +514,7 @@ class CourseGradingTest(CourseTestCase):
subgrader = CourseGradingModel.fetch_grader(self.course.id, i)
self.assertDictEqual(grader, subgrader, str(i) + "th graders not equal")
@mock.patch('track.event_transaction_utils.uuid4')
@mock.patch('common.djangoapps.track.event_transaction_utils.uuid4')
@mock.patch('cms.djangoapps.models.settings.course_grading.tracker')
@mock.patch('cms.djangoapps.contentstore.signals.signals.GRADING_POLICY_CHANGED.send')
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
@@ -651,7 +651,7 @@ class CourseGradingTest(CourseTestCase):
)
self.assertTrue(result)
@mock.patch('track.event_transaction_utils.uuid4')
@mock.patch('common.djangoapps.track.event_transaction_utils.uuid4')
@mock.patch('cms.djangoapps.models.settings.course_grading.tracker')
@mock.patch('cms.djangoapps.contentstore.signals.signals.GRADING_POLICY_CHANGED.send')
def test_update_grader_from_json(self, send_signal, tracker, uuid):
@@ -696,7 +696,7 @@ class CourseGradingTest(CourseTestCase):
) for policy_hash in {grading_policy_2, grading_policy_3}
], any_order=True)
@mock.patch('track.event_transaction_utils.uuid4')
@mock.patch('common.djangoapps.track.event_transaction_utils.uuid4')
@mock.patch('cms.djangoapps.models.settings.course_grading.tracker')
def test_update_cutoffs_from_json(self, tracker, uuid):
uuid.return_value = 'mockUUID'
@@ -757,7 +757,7 @@ class CourseGradingTest(CourseTestCase):
# Once deleted, the grace period should simply be None
self.assertEqual(None, altered_grader.grace_period, "Delete grace period")
@mock.patch('track.event_transaction_utils.uuid4')
@mock.patch('common.djangoapps.track.event_transaction_utils.uuid4')
@mock.patch('cms.djangoapps.models.settings.course_grading.tracker')
@mock.patch('cms.djangoapps.contentstore.signals.signals.GRADING_POLICY_CHANGED.send')
def test_update_section_grader_type(self, send_signal, tracker, uuid):

View File

@@ -30,8 +30,8 @@ from cms.djangoapps.contentstore.signals.handlers import listen_for_course_publi
from cms.djangoapps.contentstore.tasks import update_search_index
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_usage_url
from course_modes.models import CourseMode
from course_modes.tests.factories import CourseModeFactory
from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from openedx.core.djangoapps.models.course_details import CourseDetails
from xmodule.library_tools import normalize_key_for_search
from xmodule.modulestore import ModuleStoreEnum

View File

@@ -16,9 +16,9 @@ from cms.djangoapps.contentstore.views.item import _duplicate_item
from cms.djangoapps.contentstore.views.preview import _load_preview_module
from cms.djangoapps.contentstore.views.tests.test_library import LIBRARY_REST_URL
from cms.djangoapps.course_creators.views import add_user_with_status_granted
from student import auth
from student.auth import has_studio_read_access, has_studio_write_access
from student.roles import (
from common.djangoapps.student import auth
from common.djangoapps.student.auth import has_studio_read_access, has_studio_write_access
from common.djangoapps.student.roles import (
CourseInstructorRole,
CourseStaffRole,
LibraryUserRole,
@@ -26,8 +26,8 @@ from student.roles import (
OrgLibraryUserRole,
OrgStaffRole
)
from student.tests.factories import UserFactory
from xblock_django.user_service import DjangoXBlockUserService
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.xblock_django.user_service import DjangoXBlockUserService
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -11,7 +11,7 @@ from opaque_keys.edx.locator import BlockUsageLocator
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url
from student.models import CourseEnrollment
from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.search import path_to_location
from xmodule.modulestore.tests.factories import CourseFactory, check_mongo_calls_range

View File

@@ -10,8 +10,8 @@ from six.moves import range
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient
from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_url
from student import auth
from student.roles import CourseInstructorRole, CourseStaffRole, OrgInstructorRole, OrgStaffRole
from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole, OrgInstructorRole, OrgStaffRole
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -6,8 +6,8 @@ import six
from mock import Mock, patch
from cms.djangoapps.contentstore.signals.handlers import GRADING_POLICY_COUNTDOWN_SECONDS, handle_grading_policy_changed
from student.models import CourseEnrollment
from student.tests.factories import UserFactory
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

View File

@@ -19,7 +19,7 @@ from user_tasks.models import UserTaskArtifact, UserTaskStatus
from cms.djangoapps.contentstore.tasks import export_olx, rerun_course
from cms.djangoapps.contentstore.tests.test_libraries import LibraryTestCase
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from course_action_state.models import CourseRerunState
from common.djangoapps.course_action_state.models import CourseRerunState
from openedx.core.djangoapps.embargo.models import Country, CountryAccessRule, RestrictedCourse
from xmodule.modulestore.django import modulestore

View File

@@ -18,7 +18,7 @@ from mock import Mock, patch
from six import text_type
from cms.djangoapps.contentstore.tests.utils import mock_requests_get
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError

View File

@@ -7,7 +7,7 @@ after deleting it creates same course again
from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient
from cms.djangoapps.contentstore.utils import delete_course, reverse_url
from lms.djangoapps.courseware.tests.factories import UserFactory
from student.models import CourseEnrollment
from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -14,7 +14,7 @@ from mock import Mock
from opaque_keys.edx.keys import AssetKey, CourseKey
from cms.djangoapps.contentstore.utils import reverse_url
from student.models import Registration
from common.djangoapps.student.models import Registration
from xmodule.contentstore.django import contentstore
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.inheritance import own_metadata

View File

@@ -23,9 +23,9 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_
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
from student.models import CourseEnrollment
from student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student import auth
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError

View File

@@ -1,8 +1,8 @@
""" Helper methods for determining user access permissions in Studio """
from student import auth
from student.roles import CourseInstructorRole
from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseInstructorRole
def get_user_role(user, course_id):

View File

@@ -19,11 +19,11 @@ from opaque_keys.edx.keys import AssetKey, CourseKey
from pymongo import ASCENDING, DESCENDING
from six import text_type
from edxmako.shortcuts import render_to_response
from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.contentserver.caching import del_cached_content
from student.auth import has_course_author_access
from util.date_utils import get_default_time_display
from util.json_request import JsonResponse
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.util.date_utils import get_default_time_display
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

View File

@@ -39,12 +39,12 @@ from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import AssetKey, CourseKey
from six import text_type
from course_modes.models import CourseMode
from edxmako.shortcuts import render_to_response
from student.auth import has_studio_write_access
from student.roles import GlobalStaff
from util.db import MYSQL_MAX_INT, generate_int_id
from util.json_request import JsonResponse
from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.edxmako.shortcuts import render_to_response
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

View File

@@ -3,8 +3,8 @@ from django.core.exceptions import PermissionDenied
from django.views.decorators.csrf import ensure_csrf_cookie
from opaque_keys.edx.keys import CourseKey
from edxmako.shortcuts import render_to_response
from student.auth import has_course_author_access
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
__all__ = ['checklists_handler']

View File

@@ -21,11 +21,11 @@ from xblock.exceptions import NoSuchHandlerError
from xblock.plugin import PluginMissingError
from xblock.runtime import Mixologist
from edxmako.shortcuts import render_to_response
from common.djangoapps.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
from xblock_django.api import authorable_xblocks, disabled_xblocks
from xblock_django.models import XBlockStudioConfigurationFlag
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.xblock_django.api import authorable_xblocks, disabled_xblocks
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError

View File

@@ -35,10 +35,10 @@ from cms.djangoapps.course_creators.views import add_user_with_status_unrequeste
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 common.djangoapps.course_action_state.managers import CourseActionStateItemNotFoundError
from common.djangoapps.course_action_state.models import CourseRerunState, CourseRerunUIStateManager
from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.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
@@ -51,22 +51,26 @@ 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 student import auth
from student.auth import has_course_author_access, has_studio_read_access, has_studio_write_access
from student.roles import CourseCreatorRole, CourseInstructorRole, CourseStaffRole, GlobalStaff, UserBasedRole
from util.course import get_link_for_about_page
from util.date_utils import get_default_time_display
from util.json_request import JsonResponse, JsonResponseBadRequest, expect_json
from util.milestones_helpers import (
from common.djangoapps.student import auth
from common.djangoapps.student.auth import has_course_author_access, has_studio_read_access, has_studio_write_access
from common.djangoapps.student.roles import (
CourseCreatorRole, CourseInstructorRole, CourseStaffRole, GlobalStaff, UserBasedRole
)
from common.djangoapps.util.course import get_link_for_about_page
from common.djangoapps.util.date_utils import get_default_time_display
from common.djangoapps.util.json_request import JsonResponse, JsonResponseBadRequest, expect_json
from common.djangoapps.util.milestones_helpers import (
is_prerequisite_courses_enabled,
is_valid_course_key,
remove_prerequisite_course,
set_prerequisite_courses
)
from util.organizations_helpers import add_organization_course, get_organization_by_short_name, organizations_enabled
from util.string_utils import _has_non_ascii_characters
from openedx.core import toggles as core_toggles
from xblock_django.api import deprecated_xblocks
from common.djangoapps.util.organizations_helpers import (
add_organization_course, get_organization_by_short_name, organizations_enabled
)
from common.djangoapps.util.string_utils import _has_non_ascii_characters
from common.djangoapps.xblock_django.api import deprecated_xblocks
from xmodule.contentstore.content import StaticContent
from xmodule.course_module import DEFAULT_START_DATE, CourseFields
from xmodule.error_module import ErrorDescriptor

View File

@@ -4,7 +4,7 @@ These views will NOT be shown on production: trying to access them will result
in a 404 error.
"""
from edxmako.shortcuts import render_to_response
from common.djangoapps.edxmako.shortcuts import render_to_response
def dev_mode(request):

View File

@@ -18,8 +18,8 @@ from opaque_keys.edx.keys import CourseKey, UsageKey
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
from util import milestones_helpers
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 xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError

View File

@@ -2,9 +2,9 @@ import functools
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseServerError
from edxmako.shortcuts import render_to_response, render_to_string
from common.djangoapps.edxmako.shortcuts import render_to_response, render_to_string
from openedx.core.djangolib.js_utils import dump_js_escaped_json
from util.views import fix_crum_request
from common.djangoapps.util.views import fix_crum_request
__all__ = ['not_found', 'server_error', 'render_404', 'render_500']

View File

@@ -14,8 +14,8 @@ from django.views.decorators.csrf import ensure_csrf_cookie
from opaque_keys.edx.keys import CourseKey
import cms.djangoapps.contentstore.git_export_utils as git_export_utils
from edxmako.shortcuts import render_to_response
from student.auth import has_course_author_access
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
log = logging.getLogger(__name__)

View File

@@ -12,8 +12,8 @@ from opaque_keys.edx.keys import UsageKey
from xblock.core import XBlock
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
from edxmako.shortcuts import render_to_string
from openedx.core.toggles import ENTRANCE_EXAMS
from common.djangoapps.edxmako.shortcuts import render_to_string
from xmodule.modulestore.django import modulestore
from xmodule.tabs import StaticTab

View File

@@ -30,10 +30,10 @@ from storages.backends.s3boto import S3BotoStorage
from user_tasks.conf import settings as user_tasks_settings
from user_tasks.models import UserTaskArtifact, UserTaskStatus
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 common.djangoapps.edxmako.shortcuts import render_to_response
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.util.json_request import JsonResponse
from common.djangoapps.util.views import ensure_valid_course_key
from xmodule.modulestore.django import modulestore
from ..storage import course_import_export_storage

View File

@@ -35,16 +35,16 @@ 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 common.djangoapps.edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG
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 common.djangoapps.static_replace import replace_static_urls
from common.djangoapps.student.auth import has_studio_read_access, has_studio_write_access
from openedx.core.toggles import ENTRANCE_EXAMS
from xblock_django.user_service import DjangoXBlockUserService
from common.djangoapps.util.date_utils import get_default_time_display
from common.djangoapps.util.json_request import JsonResponse, expect_json
from common.djangoapps.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

View File

@@ -20,16 +20,16 @@ from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator
from six import text_type
from cms.djangoapps.course_creators.views import get_course_creator_status
from edxmako.shortcuts import render_to_response
from student.auth import (
from common.djangoapps.edxmako.shortcuts import render_to_response
from common.djangoapps.student.auth import (
STUDIO_EDIT_ROLES,
STUDIO_VIEW_USERS,
get_user_permissions,
has_studio_read_access,
has_studio_write_access
)
from student.roles import CourseInstructorRole, CourseStaffRole, LibraryUserRole
from util.json_request import JsonResponse, JsonResponseBadRequest, expect_json
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole, LibraryUserRole
from common.djangoapps.util.json_request import JsonResponse, JsonResponseBadRequest, expect_json
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import DuplicateCourseError

View File

@@ -7,7 +7,7 @@ from django.utils.decorators import method_decorator
from django.views.generic import View
from openedx.core.djangolib.js_utils import dump_js_escaped_json
from util.organizations_helpers import get_organizations
from common.djangoapps.util.organizations_helpers import get_organizations
class OrganizationListView(View):

View File

@@ -16,10 +16,10 @@ from xblock.django.request import django_to_webob_request, webob_to_django_respo
from xblock.exceptions import NoSuchHandlerError
from xblock.runtime import KvsFieldData
import static_replace
from common.djangoapps import static_replace
from cms.djangoapps.xblock_config.models import StudioConfig
from cms.lib.xblock.field_data import CmsFieldData
from edxmako.shortcuts import render_to_string
from common.djangoapps.edxmako.shortcuts import render_to_string
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
from openedx.core.lib.license import wrap_with_license
from openedx.core.lib.xblock_utils import (
@@ -30,7 +30,7 @@ from openedx.core.lib.xblock_utils import (
wrap_xblock_aside,
xblock_local_resource_url
)
from xblock_django.user_service import DjangoXBlockUserService
from common.djangoapps.xblock_django.user_service import DjangoXBlockUserService
from xmodule.contentstore.django import contentstore
from xmodule.error_module import ErrorDescriptor
from xmodule.exceptions import NotFoundError, ProcessingError

View File

@@ -8,7 +8,7 @@ from django.shortcuts import redirect
from django.utils.http import urlquote_plus
from waffle.decorators import waffle_switch
from edxmako.shortcuts import render_to_response
from common.djangoapps.edxmako.shortcuts import render_to_response
from ..config import waffle

View File

@@ -11,9 +11,9 @@ from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods
from opaque_keys.edx.keys import CourseKey, UsageKey
from edxmako.shortcuts import render_to_response
from student.auth import has_course_author_access
from util.json_request import JsonResponse, expect_json
from common.djangoapps.edxmako.shortcuts import render_to_response
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.util.json_request import JsonResponse, expect_json
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.tabs import CourseTab, CourseTabList, InvalidTabsException, StaticTab

View File

@@ -7,9 +7,9 @@ from django.contrib.auth.models import User
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from student.auth import add_users
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import AdminFactory
from common.djangoapps.student.auth import add_users
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student.tests.factories import AdminFactory
from ..access import get_user_role

View File

@@ -21,7 +21,7 @@ from pytz import UTC
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url
from cms.djangoapps.contentstore.views import assets
from static_replace import replace_static_urls
from common.djangoapps.static_replace import replace_static_urls
from xmodule.assetstore import AssetMetadata
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore

View File

@@ -18,11 +18,11 @@ 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 course_modes.tests.factories import CourseModeFactory
from student.models import CourseEnrollment
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import UserFactory
from util.testing import EventTestMixin, UrlResetMixin
from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util.testing import EventTestMixin, UrlResetMixin
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError

View File

@@ -21,12 +21,12 @@ from search.api import perform_search
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_action_state.managers import CourseRerunUIStateManager
from course_action_state.models import CourseRerunState
from common.djangoapps.course_action_state.managers import CourseRerunUIStateManager
from common.djangoapps.course_action_state.models import CourseRerunState
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES
from student.auth import has_course_author_access
from student.roles import CourseStaffRole, GlobalStaff, LibraryUserRole
from student.tests.factories import UserFactory
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.student.roles import CourseStaffRole, GlobalStaff, LibraryUserRole
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, LibraryFactory, check_mongo_calls

View File

@@ -17,8 +17,8 @@ from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient, Cours
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 common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util import milestones_helpers
from xmodule.modulestore.django import modulestore
from ..entrance_exam import (

View File

@@ -11,7 +11,7 @@ from django.test.utils import override_settings
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url
from util.testing import UrlResetMixin
from common.djangoapps.util.testing import UrlResetMixin
FEATURES_WITH_CERTS_ENABLED = settings.FEATURES.copy()
FEATURES_WITH_CERTS_ENABLED['CERTIFICATES_HTML_VIEW'] = True

View File

@@ -10,7 +10,7 @@ from django.test.utils import override_settings
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url
from util.testing import UrlResetMixin
from common.djangoapps.util.testing import UrlResetMixin
FEATURES_WITH_CERTS_ENABLED = settings.FEATURES.copy()
FEATURES_WITH_CERTS_ENABLED['CERTIFICATES_HTML_VIEW'] = True

View File

@@ -31,9 +31,9 @@ from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
from openedx.core.lib.extract_tar import safetar_extractall
from student import auth
from student.roles import CourseInstructorRole, CourseStaffRole
from util import milestones_helpers
from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.util import milestones_helpers
from xmodule.contentstore.django import contentstore
from xmodule.modulestore import LIBRARY_ROOT, ModuleStoreEnum
from xmodule.modulestore.django import modulestore

View File

@@ -36,9 +36,11 @@ 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 lms.djangoapps.lms_xblock.mixin import NONSENSICAL_ACCESS_RESTRICTION
from student.tests.factories import UserFactory
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag
from xblock_django.user_service import DjangoXBlockUserService
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.xblock_django.models import (
XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag
)
from common.djangoapps.xblock_django.user_service import DjangoXBlockUserService
from xmodule.capa_module import ProblemBlock
from xmodule.course_module import DEFAULT_START_DATE
from xmodule.modulestore import ModuleStoreEnum

View File

@@ -17,7 +17,7 @@ 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 cms.djangoapps.course_creators.views import add_user_with_status_granted as grant_course_creator_status
from student.roles import LibraryUserRole
from common.djangoapps.student.roles import LibraryUserRole
from xmodule.modulestore.tests.factories import LibraryFactory
from ..component import get_component_templates

View File

@@ -7,8 +7,8 @@ from django.test import TestCase
from django.urls import reverse
from mock import patch
from student.tests.factories import UserFactory
from util.organizations_helpers import add_organization
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util.organizations_helpers import add_organization
@patch.dict('django.conf.settings.FEATURES', {'ORGANIZATIONS_APP': True})

View File

@@ -13,7 +13,7 @@ from xblock.core import XBlock, XBlockAside
from cms.djangoapps.contentstore.utils import reverse_usage_url
from cms.djangoapps.xblock_config.models import StudioConfig
from student.tests.factories import UserFactory
from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -14,7 +14,7 @@ from mock import ANY, Mock, patch
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 student.roles import CourseStaffRole
from common.djangoapps.student.roles import CourseStaffRole
from ..transcript_settings import TranscriptionProviderErrorType, validate_transcript_credentials

View File

@@ -9,9 +9,9 @@ from django.contrib.auth.models import User
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
from cms.djangoapps.contentstore.utils import reverse_course_url
from student import auth
from student.models import CourseEnrollment
from student.roles import CourseInstructorRole, CourseStaffRole
from common.djangoapps.student import auth
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
class UsersTestCase(CourseTestCase):

View File

@@ -23,8 +23,8 @@ 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 common.djangoapps.student.auth import has_studio_write_access
from common.djangoapps.util.json_request import JsonResponse, expect_json
from xmodule.video_module.transcripts_utils import Transcript, TranscriptsGenerationException
from .videos import TranscriptProvider

View File

@@ -25,8 +25,8 @@ from opaque_keys.edx.keys import UsageKey
from six import text_type
from cms.djangoapps.contentstore.views.videos import TranscriptProvider
from student.auth import has_course_author_access
from util.json_request import JsonResponse
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

View File

@@ -12,12 +12,12 @@ from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import LibraryLocator
from cms.djangoapps.course_creators.views import user_requested_access
from edxmako.shortcuts import render_to_response
from student import auth
from student.auth import STUDIO_EDIT_ROLES, STUDIO_VIEW_USERS, get_user_permissions
from student.models import CourseEnrollment
from student.roles import CourseInstructorRole, CourseStaffRole, LibraryUserRole
from util.json_request import JsonResponse, expect_json
from common.djangoapps.edxmako.shortcuts import render_to_response
from common.djangoapps.student import auth
from common.djangoapps.student.auth import STUDIO_EDIT_ROLES, STUDIO_VIEW_USERS, get_user_permissions
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
__all__ = ['request_course_creator', 'course_team_handler']

View File

@@ -45,7 +45,7 @@ from rest_framework.decorators import api_view
from rest_framework.response import Response
from edx_toggles.toggles import WaffleFlagNamespace, WaffleSwitchNamespace
from edxmako.shortcuts import render_to_response
from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.video_config.models import VideoTranscriptEnabledFlag
from openedx.core.djangoapps.video_pipeline.config.waffle import (
DEPRECATE_YOUTUBE,
@@ -54,7 +54,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 util.json_request import JsonResponse, expect_json
from common.djangoapps.util.json_request import JsonResponse, expect_json
from xmodule.video_module.transcripts_utils import Transcript
from ..models import VideoUploadConfig

View File

@@ -18,7 +18,7 @@ from cms.djangoapps.course_creators.models import (
update_creator_state
)
from cms.djangoapps.course_creators.views import update_course_creator_group
from edxmako.shortcuts import render_to_string
from common.djangoapps.edxmako.shortcuts import render_to_string
log = logging.getLogger("studio.coursecreatoradmin")

View File

@@ -13,8 +13,8 @@ from six.moves import range
from cms.djangoapps.course_creators.admin import CourseCreatorAdmin
from cms.djangoapps.course_creators.models import CourseCreator
from student import auth
from student.roles import CourseCreatorRole
from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseCreatorRole
def mock_render_to_string(template_name, context):

View File

@@ -16,8 +16,8 @@ from cms.djangoapps.course_creators.views import (
update_course_creator_group,
user_requested_access
)
from student import auth
from student.roles import CourseCreatorRole
from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseCreatorRole
class CourseCreatorView(TestCase):

View File

@@ -4,8 +4,8 @@ Methods for interacting programmatically with the user creator table.
from cms.djangoapps.course_creators.models import CourseCreator
from student import auth
from student.roles import CourseCreatorRole
from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseCreatorRole
def add_user_with_status_unrequested(user):

View File

@@ -12,7 +12,7 @@ from django.urls import reverse
from cms.djangoapps.contentstore.management.commands.utils import get_course_versions
from openedx.features.announcements.models import Announcement
from student.tests.factories import AdminFactory, UserFactory
from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -19,11 +19,11 @@ from opaque_keys.edx.keys import CourseKey
from six import text_type
from cms.djangoapps.contentstore.management.commands.utils import get_course_versions
from edxmako.shortcuts import render_to_response
from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.features.announcements.forms import AnnouncementForm
from openedx.features.announcements.models import Announcement
from util.json_request import JsonResponse
from util.views import require_global_staff
from common.djangoapps.util.json_request import JsonResponse
from common.djangoapps.util.views import require_global_staff
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError

View File

@@ -12,7 +12,7 @@ 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 common.djangoapps.track.event_transaction_utils import create_new_event_transaction_id
from xmodule.modulestore.django import modulestore
log = logging.getLogger(__name__)

View File

@@ -16,8 +16,8 @@ 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 xblock_django.models import XBlockStudioConfigurationFlag
from common.djangoapps.student.roles import GlobalStaff
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.modulestore.django import modulestore

View File

@@ -78,7 +78,7 @@
"localhost"
],
"port": 27017,
"render_template": "edxmako.shortcuts.render_to_string"
"render_template": "common.djangoapps.edxmako.shortcuts.render_to_string"
}
},
{

View File

@@ -4,7 +4,7 @@
"CACHES": {
"celery": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_celery",
"LOCATION": [
"localhost:11211"
@@ -12,7 +12,7 @@
},
"default": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_default",
"LOCATION": [
"localhost:11211"
@@ -20,7 +20,7 @@
},
"general": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_general",
"LOCATION": [
"localhost:11211"
@@ -28,7 +28,7 @@
},
"mongo_metadata_inheritance": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_mongo_metadata_inheritance",
"LOCATION": [
"localhost:11211"
@@ -36,7 +36,7 @@
},
"staticfiles": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_static_files",
"LOCATION": [
"localhost:11211"

View File

@@ -90,7 +90,7 @@ MEDIA_ROOT = TEST_ROOT / "uploads"
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = TEST_ROOT / "staticfiles" / "cms" / "webpack-stats.json"
LOG_OVERRIDES = [
('track.middleware', logging.CRITICAL),
('common.djangoapps.track.middleware', logging.CRITICAL),
('edx.discussion', logging.CRITICAL),
]
for log_name, log_level in LOG_OVERRIDES:

View File

@@ -7,27 +7,27 @@ BULK_EMAIL_DEFAULT_FROM_EMAIL: no-reply@example.com
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['localhost:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['localhost:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['localhost:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['localhost:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['localhost:11211']
CELERY_ALWAYS_EAGER: true

View File

@@ -78,7 +78,7 @@
"edx.devstack.mongo"
],
"port": 27017,
"render_template": "edxmako.shortcuts.render_to_string"
"render_template": "common.djangoapps.edxmako.shortcuts.render_to_string"
}
},
{

View File

@@ -4,7 +4,7 @@
"CACHES": {
"celery": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_celery",
"LOCATION": [
"edx.devstack.memcached:11211"
@@ -12,7 +12,7 @@
},
"default": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_default",
"LOCATION": [
"edx.devstack.memcached:11211"
@@ -20,7 +20,7 @@
},
"general": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_general",
"LOCATION": [
"edx.devstack.memcached:11211"
@@ -28,7 +28,7 @@
},
"mongo_metadata_inheritance": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_mongo_metadata_inheritance",
"LOCATION": [
"edx.devstack.memcached:11211"
@@ -36,7 +36,7 @@
},
"staticfiles": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"KEY_FUNCTION": "util.memcache.safe_key",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_static_files",
"LOCATION": [
"edx.devstack.memcached:11211"

View File

@@ -7,27 +7,27 @@ BULK_EMAIL_DEFAULT_FROM_EMAIL: no-reply@example.com
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['edx.devstack.memcached:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['edx.devstack.memcached:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['edx.devstack.memcached:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['edx.devstack.memcached:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
KEY_FUNCTION: util.memcache.safe_key
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['edx.devstack.memcached:11211']
CELERY_ALWAYS_EAGER: true

View File

@@ -447,12 +447,10 @@ COURSES_ROOT = ENV_ROOT / "data"
GITHUB_REPO_ROOT = ENV_ROOT / "data"
# TODO: Is this next line necessary?
sys.path.append(REPO_ROOT)
# TODO: The next two path modifications will be removed in an upcoming Open edX release.
# TODO: This path modification exists as temporary support for deprecated import patterns.
# It will be removed in an upcoming Open edX release.
# See docs/decisions/0007-sys-path-modification-removal.rst
sys.path.append(REPO_ROOT / 'import_shims' / 'studio')
sys.path.append(COMMON_ROOT / 'djangoapps')
# For geolocation ip database
GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoLite2-Country.mmdb"
@@ -511,8 +509,8 @@ TEMPLATES = [
# We have to use mako-aware template loaders to be able to include
# mako templates inside django templates (such as main_django.html).
'openedx.core.djangoapps.theming.template_loaders.ThemeTemplateLoader',
'edxmako.makoloader.MakoFilesystemLoader',
'edxmako.makoloader.MakoAppDirectoriesLoader',
'common.djangoapps.edxmako.makoloader.MakoFilesystemLoader',
'common.djangoapps.edxmako.makoloader.MakoAppDirectoriesLoader',
),
'context_processors': CONTEXT_PROCESSORS,
# Change 'debug' in your environment settings files - not here.
@@ -521,7 +519,7 @@ TEMPLATES = [
},
{
'NAME': 'mako',
'BACKEND': 'edxmako.backend.Mako',
'BACKEND': 'common.djangoapps.edxmako.backend.Mako',
'APP_DIRS': False,
'DIRS': _make_mako_template_dirs,
'OPTIONS': {
@@ -532,7 +530,7 @@ TEMPLATES = [
{
# This separate copy of the Mako backend is used to render previews using the LMS templates
'NAME': 'preview',
'BACKEND': 'edxmako.backend.Mako',
'BACKEND': 'common.djangoapps.edxmako.backend.Mako',
'APP_DIRS': False,
'DIRS': lms.envs.common.MAKO_TEMPLATE_DIRS_BASE,
'OPTIONS': {
@@ -691,11 +689,11 @@ MIDDLEWARE = [
# Instead of AuthenticationMiddleware, we use a cache-backed version
'openedx.core.djangoapps.cache_toolbox.middleware.CacheBackedAuthenticationMiddleware',
'student.middleware.UserStandingMiddleware',
'common.djangoapps.student.middleware.UserStandingMiddleware',
'openedx.core.djangoapps.contentserver.middleware.StaticContentServer',
'django.contrib.messages.middleware.MessageMiddleware',
'track.middleware.TrackMiddleware',
'common.djangoapps.track.middleware.TrackMiddleware',
# This is used to set or update the user language preferences.
'openedx.core.djangoapps.lang_pref.middleware.LanguagePreferenceMiddleware',
@@ -833,7 +831,7 @@ MODULESTORE = {
'OPTIONS': {
'default_class': 'xmodule.hidden_module.HiddenDescriptor',
'fs_root': DATA_DIR,
'render_template': 'edxmako.shortcuts.render_to_string',
'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string',
}
},
{
@@ -843,7 +841,7 @@ MODULESTORE = {
'OPTIONS': {
'default_class': 'xmodule.hidden_module.HiddenDescriptor',
'fs_root': DATA_DIR,
'render_template': 'edxmako.shortcuts.render_to_string',
'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string',
}
}
]
@@ -1347,7 +1345,7 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.contentserver',
'cms.djangoapps.course_creators',
'student.apps.StudentConfig', # misleading name due to sharing with lms
'common.djangoapps.student.apps.StudentConfig', # misleading name due to sharing with lms
'openedx.core.djangoapps.course_groups', # not used in cms (yet), but tests run
'cms.djangoapps.xblock_config.apps.XBlockConfig',
@@ -1359,13 +1357,13 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.util.apps.UtilConfig',
# Tracking
'track',
'common.djangoapps.track',
'eventtracking.django.apps.EventTrackingConfig',
# For asset pipelining
'edxmako.apps.EdxMakoConfig',
'common.djangoapps.edxmako.apps.EdxMakoConfig',
'pipeline',
'static_replace',
'common.djangoapps.static_replace',
'require',
'webpack_loader',
@@ -1382,7 +1380,7 @@ INSTALLED_APPS = [
'django.contrib.admin',
# for managing course modes
'course_modes.apps.CourseModesConfig',
'common.djangoapps.course_modes.apps.CourseModesConfig',
# Verified Track Content Cohorting (Beta feature that will hopefully be removed)
'openedx.core.djangoapps.verified_track_content',
@@ -1403,7 +1401,7 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.embargo',
# Course action state
'course_action_state',
'common.djangoapps.course_action_state',
# Additional problem types
'edx_jsme', # Molecular Structure
@@ -1423,7 +1421,7 @@ INSTALLED_APPS = [
# Credit courses
'openedx.core.djangoapps.credit.apps.CreditConfig',
'xblock_django',
'common.djangoapps.xblock_django',
# Catalog integration
'openedx.core.djangoapps.catalog',
@@ -1470,7 +1468,7 @@ INSTALLED_APPS = [
'cms.djangoapps.cms_user_tasks.apps.CmsUserTasksConfig',
# Unusual migrations
'database_fixups',
'common.djangoapps.database_fixups',
# Customized celery tasks, including persisting failed tasks so they can
# be retried
@@ -1487,10 +1485,10 @@ INSTALLED_APPS = [
'csrf.apps.CsrfAppConfig', # Enables frontend apps to retrieve CSRF tokens.
# Entitlements, used in openedx tests
'entitlements',
'common.djangoapps.entitlements',
# Asset management for mako templates
'pipeline_mako',
'common.djangoapps.pipeline_mako',
# API Documentation
'drf_yasg',
@@ -1542,7 +1540,7 @@ TRACK_MAX_EVENT = 50000
TRACKING_BACKENDS = {
'logger': {
'ENGINE': 'track.backends.logger.LoggerBackend',
'ENGINE': 'common.djangoapps.track.backends.logger.LoggerBackend',
'OPTIONS': {
'name': 'tracking'
}
@@ -1568,8 +1566,8 @@ EVENT_TRACKING_BACKENDS = {
}
},
'processors': [
{'ENGINE': 'track.shim.LegacyFieldMappingProcessor'},
{'ENGINE': 'track.shim.PrefixedEventProcessor'}
{'ENGINE': 'common.djangoapps.track.shim.LegacyFieldMappingProcessor'},
{'ENGINE': 'common.djangoapps.track.shim.PrefixedEventProcessor'}
]
}
},
@@ -1587,7 +1585,7 @@ EVENT_TRACKING_BACKENDS = {
}
},
{
'ENGINE': 'track.shim.GoogleAnalyticsProcessor'
'ENGINE': 'common.djangoapps.track.shim.GoogleAnalyticsProcessor'
}
]
}
@@ -1603,13 +1601,13 @@ AUTH_PASSWORD_VALIDATORS = [
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "util.password_policy_validators.MinimumLengthValidator",
"NAME": "common.djangoapps.util.password_policy_validators.MinimumLengthValidator",
"OPTIONS": {
"min_length": 2
}
},
{
"NAME": "util.password_policy_validators.MaximumLengthValidator",
"NAME": "common.djangoapps.util.password_policy_validators.MaximumLengthValidator",
"OPTIONS": {
"max_length": 75
}
@@ -1858,53 +1856,53 @@ DATABASE_ROUTERS = [
CACHES = {
'blockstore': {
'KEY_PREFIX': 'blockstore',
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '86400', # This data should be long-lived for performance, BundleCache handles invalidation
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'course_structure_cache': {
'KEY_PREFIX': 'course_structure',
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'celery': {
'KEY_PREFIX': 'celery',
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'mongo_metadata_inheritance': {
'KEY_PREFIX': 'mongo_metadata_inheritance',
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': 300,
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'staticfiles': {
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'staticfiles_general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'default': {
'VERSION': '1',
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'default',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'configuration': {
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'configuration',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'general': {
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',

View File

@@ -26,7 +26,7 @@ CMS_BASE = 'localhost:18010'
# Disable noisy loggers
for pkg_name in ['track.contexts', 'track.middleware']:
for pkg_name in ['common.djangoapps.track.contexts', 'common.djangoapps.track.middleware']:
logging.getLogger(pkg_name).setLevel(logging.CRITICAL)
# Docker does not support the syslog socket at /dev/log. Rely on the console.

View File

@@ -24,7 +24,7 @@ CMS_BASE = 'localhost:8010'
# Disable noisy loggers
for pkg_name in ['track.contexts', 'track.middleware']:
for pkg_name in ['common.djangoapps.track.contexts', 'common.djangoapps.track.middleware']:
logging.getLogger(pkg_name).setLevel(logging.CRITICAL)
# Docker does not support the syslog socket at /dev/log. Rely on the console.

View File

@@ -146,7 +146,7 @@ CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'edx_loc_mem_cache',
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
},
# The general cache is what you get if you use our util.cache. It's used for
@@ -158,14 +158,14 @@ CACHES = {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'KEY_PREFIX': 'general',
'VERSION': 4,
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
},
'mongo_metadata_inheritance': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': os.path.join(tempfile.gettempdir(), 'mongo_metadata_inheritance'),
'TIMEOUT': 300,
'KEY_FUNCTION': 'util.memcache.safe_key',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
},
'loc_cache': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',

View File

@@ -11,7 +11,7 @@ from webob import Response
from xblock.core import XBlock, XBlockAside
from xblock.fields import Dict, Scope
from edxmako.shortcuts import render_to_string
from common.djangoapps.edxmako.shortcuts import render_to_string
from xmodule.capa_module import ProblemBlock
from xmodule.x_module import AUTHOR_VIEW

View File

@@ -23,7 +23,7 @@ from cms.djangoapps.contentstore.views.preview import get_preview_fragment
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 common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

View File

@@ -6,7 +6,7 @@ Tests for the Studio authoring XBlock mixin.
from django.conf import settings
from django.test.utils import override_settings
from course_modes.tests.factories import CourseModeFactory
from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.partitions.partitions import (

View File

@@ -10,7 +10,7 @@
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
from util.course import has_certificates_enabled
from common.djangoapps.util.course import has_certificates_enabled
%>
<%block name="title">${_("Checklists")}</%block>
<%block name="bodyclass">is-signedin course view-checklists</%block>

View File

@@ -7,7 +7,7 @@ import six
from six.moves.urllib.parse import quote
from cms.djangoapps.contentstore.config.waffle_utils import should_show_checklists_quality
from util.date_utils import get_default_time_display
from common.djangoapps.util.date_utils import get_default_time_display
from django.utils.translation import ugettext as _
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
from openedx.core.djangolib.markup import HTML, Text

View File

@@ -5,7 +5,7 @@
from django.urls import reverse
from django.utils.translation import ugettext as _
from edx_django_utils.monitoring import set_custom_attribute
from student.roles import GlobalStaff
from common.djangoapps.student.roles import GlobalStaff
%>
<h3 class="title">

View File

@@ -44,7 +44,7 @@ LIBRARY_KEY_PATTERN = r'(?P<library_key_string>library-v1:[^/+]+\+[^/+]+)'
urlpatterns = [
url(r'', include('openedx.core.djangoapps.user_authn.urls_common')),
url(r'', include('student.urls')),
url(r'', include('common.djangoapps.student.urls')),
url(r'^transcripts/upload$', contentstore_views.upload_transcripts, name='upload_transcripts'),
url(r'^transcripts/download$', contentstore_views.download_transcripts, name='download_transcripts'),
url(r'^transcripts/check$', contentstore_views.check_transcripts, name='check_transcripts'),

View File

View File

@@ -13,7 +13,7 @@ file and check it in at the same time as your model changes. To do that,
from django.contrib.auth.models import User
from django.db import models
from opaque_keys.edx.django.models import CourseKeyField
from course_action_state.managers import CourseActionStateManager, CourseRerunUIStateManager
from common.djangoapps.course_action_state.managers import CourseActionStateManager, CourseRerunUIStateManager
class CourseActionState(models.Model):

View File

@@ -10,8 +10,8 @@ from django.test import TestCase
from opaque_keys.edx.locations import CourseLocator
from six.moves import range
from course_action_state.managers import CourseActionStateItemNotFoundError
from course_action_state.models import CourseRerunState
from common.djangoapps.course_action_state.managers import CourseActionStateItemNotFoundError
from common.djangoapps.course_action_state.models import CourseRerunState
# Sequence of Action models to be tested with ddt.
COURSE_ACTION_STATES = (CourseRerunState, )

View File

@@ -7,9 +7,9 @@ from django.test import TestCase
from opaque_keys.edx.locations import CourseLocator
from six import text_type
from course_action_state.managers import CourseRerunUIStateManager
from course_action_state.models import CourseRerunState
from student.tests.factories import UserFactory
from common.djangoapps.course_action_state.managers import CourseRerunUIStateManager
from common.djangoapps.course_action_state.models import CourseRerunState
from common.djangoapps.student.tests.factories import UserFactory
class TestCourseRerunStateManager(TestCase):

View File

@@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
from opaque_keys.edx.keys import CourseKey
from pytz import UTC, timezone
from course_modes.models import CourseMode, CourseModeExpirationConfig
from common.djangoapps.course_modes.models import CourseMode, CourseModeExpirationConfig
# Technically, we shouldn't be doing this, since verify_student is defined
# in LMS, and course_modes is defined in common.
#
@@ -23,7 +23,7 @@ from course_modes.models import CourseMode, CourseModeExpirationConfig
# the verification deadline table won't exist.
from lms.djangoapps.verify_student import models as verification_models
from openedx.core.lib.courses import clean_course_id
from util.date_utils import get_time_display
from common.djangoapps.util.date_utils import get_time_display
COURSE_MODE_SLUG_CHOICES = [(key, enrollment_mode['display_name'])
for key, enrollment_mode in six.iteritems(settings.COURSE_ENROLLMENT_MODES)]

View File

@@ -2,7 +2,7 @@
Python APIs exposed by the course_modes app to other in-process apps.
"""
from course_modes.models import CourseMode as _CourseMode
from common.djangoapps.course_modes.models import CourseMode as _CourseMode
def get_paid_modes_for_course(course_run_id):

View File

@@ -5,8 +5,8 @@ from django.apps import AppConfig
class CourseModesConfig(AppConfig):
name = 'course_modes'
name = 'common.djangoapps.course_modes'
verbose_name = "Course Modes"
def ready(self):
import course_modes.signals # pylint: disable=unused-import
from . import signals # pylint: disable=unused-import

Some files were not shown because too many files have changed in this diff Show More