def get_lms_link_for_certificate_web_view(user_id, course_key, mode):
 assert isinstance(course_key, CourseKey)
 lms_base = SiteConfiguration.get_value_for_org(course_key.org, 'LMS_BASE', settings.LMS_BASE)
 if (lms_base is None):
  return None
 return u'//{certificate_web_base}/certificates/user/{user_id}/course/{course_id}?preview={mode}'.format(certificate_web_base=lms_base, user_id=user_id, course_id=unicode(course_key), mode=mode)

def get_lms_link_for_certificate_web_view ( user_id , course_key , mode ) : assert isinstance ( course_key , CourseKey ) lms_base = SiteConfiguration . get_value_for_org ( course_key . org , 'LMS_BASE' , settings . LMS_BASE ) if ( lms_base is None ) : return None return u'//{certificate_web_base}/certificates/user/{user_id}/course/{course_id}?preview={mode}' . format ( certificate_web_base = lms_base , user_id = user_id , course_id = unicode ( course_key ) , mode = mode )
returns the url to the certificate web view .