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

@@ -13,8 +13,8 @@ from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from rest_framework.status import HTTP_200_OK, HTTP_201_CREATED
from lms.djangoapps.courseware.courses import get_course_by_id
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.lib.courses import get_course_by_id
from common.djangoapps.student.models import anonymous_id_for_user
from common.djangoapps.student.roles import CourseInstructorRole