def get_lms_link_for_item(location, preview=False):
 assert isinstance(location, UsageKey)
 lms_base = SiteConfiguration.get_value_for_org(location.org, 'LMS_BASE', settings.LMS_BASE)
 if (lms_base is None):
  return None
 if preview:
  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(lms_base=lms_base, course_key=location.course_key.to_deprecated_string(), location=location.to_deprecated_string())

def get_lms_link_for_item ( location , preview = False ) : assert isinstance ( location , UsageKey ) lms_base = SiteConfiguration . get_value_for_org ( location . org , 'LMS_BASE' , settings . LMS_BASE ) if ( lms_base is None ) : return None if preview : 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 ( lms_base = lms_base , course_key = location . course_key . to_deprecated_string ( ) , location = location . to_deprecated_string ( ) )
returns an lms link to the course with a jump_to to the provided location .