Skip to content
Snippets Groups Projects
Commit fbb64069 authored by stvn's avatar stvn
Browse files

fix: Try importing LMS helper from new path

Fall-back to the old path.

Once the LMS has fully switched over to this new path [1],
we can remove the legacy (LMS) import support here.

- [1] https://github.com/edx/edx-platform/pull/27289
parent 2fd330f8
No related branches found
No related tags found
No related merge requests found
......@@ -108,9 +108,17 @@ def user_has_access(*args, **kwargs):
def get_course_by_id(course_key):
"""
Import and run `get_course_by_id` from LMS
TODO: Once the LMS has fully switched over to this new path [1],
we can remove the legacy (LMS) import support here.
- [1] https://github.com/edx/edx-platform/pull/27289
"""
# pylint: disable=import-error,import-outside-toplevel
from lms.djangoapps.courseware.courses import get_course_by_id as lms_get_course_by_id
try:
from openedx.core.lib.courses import get_course_by_id as lms_get_course_by_id
except ImportError:
from lms.djangoapps.courseware.courses import get_course_by_id as lms_get_course_by_id
return lms_get_course_by_id(course_key)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment