Files
edx-platform/common/djangoapps/util/course.py
Calen Pennington 04115bfe43 Revert "Merge pull request #13235 from edx/jia/MA-2684"
This reverts commit bde0f7b2a7, reversing
changes made to 71693c3a12.
2016-12-21 13:21:47 -05:00

29 lines
825 B
Python

"""
Utility methods related to course
"""
import logging
from django.conf import settings
from opaque_keys.edx.keys import CourseKey
log = logging.getLogger(__name__)
def get_lms_link_for_about_page(course_key):
"""
Returns the url to the course about page.
"""
assert isinstance(course_key, CourseKey)
if settings.FEATURES.get('ENABLE_MKTG_SITE'):
# Root will be "https://www.edx.org". The complete URL will still not be exactly correct,
# but redirects exist from www.edx.org to get to the Drupal course about page URL.
about_base = settings.MKTG_URLS['ROOT']
else:
about_base = settings.LMS_ROOT_URL
return u"{about_base_url}/courses/{course_key}/about".format(
about_base_url=about_base,
course_key=course_key.to_deprecated_string()
)