Commit b2572ee2 by Hasnain Committed by Douglas Hall

WL-614 | In Studio "View Live" button fix for theming feature.

parent fa2b1ae4
...@@ -13,6 +13,7 @@ from django_comment_common.models import assign_default_role ...@@ -13,6 +13,7 @@ from django_comment_common.models import assign_default_role
from django_comment_common.utils import seed_permissions_roles from django_comment_common.utils import seed_permissions_roles
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
...@@ -88,13 +89,25 @@ def get_lms_link_for_item(location, preview=False): ...@@ -88,13 +89,25 @@ def get_lms_link_for_item(location, preview=False):
""" """
assert isinstance(location, UsageKey) assert isinstance(location, UsageKey)
if settings.LMS_BASE is None: # checks LMS_BASE value in site configuration for the given course_org_filter(org)
# if not found returns settings.LMS_BASE
lms_base = SiteConfiguration.get_value_for_org(
location.org,
"LMS_BASE",
settings.LMS_BASE
)
if lms_base is None:
return None return None
if preview: if preview:
lms_base = settings.FEATURES.get('PREVIEW_LMS_BASE') # checks PREVIEW_LMS_BASE value in site configuration for the given course_org_filter(org)
else: # if not found returns settings.FEATURES.get('PREVIEW_LMS_BASE')
lms_base = settings.LMS_BASE lms_base = SiteConfiguration.get_value_for_org(
location.org,
"PREVIEW_LMS_BASE",
settings.FEATURES.get('PREVIEW_LMS_BASE')
)
return u"//{lms_base}/courses/{course_key}/jump_to/{location}".format( return u"//{lms_base}/courses/{course_key}/jump_to/{location}".format(
lms_base=lms_base, lms_base=lms_base,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment