refactor: Move get_course_by_id helper from LMS to core

This helper is used by the LMS, CMS, _and_ `openedx.core`,
so let's move it to `openedx.core` to reduce import complexity.

The following files no longer import from LMS:
- cms/djangoapps/contentstore/management/commands/edit_course_tabs.py
- lms/djangoapps/ccx/migrations/0006_set_display_name_as_override.py
- openedx/core/djangoapps/ccxcon/api.py
- openedx/core/djangoapps/verified_track_content/models.py
- openedx/features/course_experience/plugins.py

Note: The LTI XBlock has a dependency on this import path (!?);
a fix can be found here [1].

- [1] https://github.com/edx/xblock-lti-consumer/pull/154
This commit is contained in:
stvn
2021-04-08 15:02:18 -07:00
parent 01199fc221
commit 43698fff0a
31 changed files with 63 additions and 52 deletions

View File

@@ -8,8 +8,8 @@ This includes any locally defined CourseTools.
from django.urls import reverse
from django.utils.translation import ugettext as _
from lms.djangoapps.courseware.courses import get_course_by_id
from common.djangoapps.student.models import CourseEnrollment
from openedx.core.lib.courses import get_course_by_id
from . import DISABLE_UNIFIED_COURSE_TAB_FLAG
from .course_tools import CourseTool