def has_html_certificates_enabled(course_key, course=None):
 if (not settings.FEATURES.get('CERTIFICATES_HTML_VIEW', False)):
  return False
 if (not course):
  if (not isinstance(course_key, CourseKey)):
   try:
    course_key = CourseKey.from_string(course_key)
   except InvalidKeyError:
    log.warning(('Unable to parse course_key "%s"', course_key), exc_info=True)
    return False
  try:
   course = CourseOverview.get_from_id(course_key)
  except:
   log.warning(('Unable to load CourseOverview object for course_key "%s"', unicode(course_key)), exc_info=True)
 return (course.cert_html_view_enabled if course else False)

def has_html_certificates_enabled ( course_key , course = None ) : if ( not settings . FEATURES . get ( 'CERTIFICATES_HTML_VIEW' , False ) ) : return False if ( not course ) : if ( not isinstance ( course_key , CourseKey ) ) : try : course_key = CourseKey . from_string ( course_key ) except InvalidKeyError : log . warning ( ( 'Unable to parse course_key "%s"' , course_key ) , exc_info = True ) return False try : course = CourseOverview . get_from_id ( course_key ) except : log . warning ( ( 'Unable to load CourseOverview object for course_key "%s"' , unicode ( course_key ) ) , exc_info = True ) return ( course . cert_html_view_enabled if course else False )
determine if a course has html certificates enabled .