diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 884dc40df2..e00e62a7c0 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -29,7 +29,7 @@ class CourseDescriptor(SequenceDescriptor): def has_started(self): return time.gmtime() > self.start - + @classmethod def id_to_location(cls, course_id): org, course, name = course_id.split('/') @@ -39,6 +39,10 @@ class CourseDescriptor(SequenceDescriptor): def id(self): return "/".join([self.location.org, self.location.course, self.location.name]) + @property + def start_date_text(self): + return time.strftime("%m/%d/%y", self.start) + @property def title(self): return self.metadata['display_name'] @@ -86,8 +90,8 @@ class CourseDescriptor(SequenceDescriptor): with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile: return htmlFile.read().decode('utf-8') except ResourceNotFoundError: - log.exception("Missing about section {key} in course {url}".format(key=section_key, url=self.location.url())) - return "! About section missing !" + log.warning("Missing about section {key} in course {url}".format(key=section_key, url=self.location.url())) + return None elif section_key == "title": return self.metadata.get('display_name', self.name) elif section_key == "university": diff --git a/lms/templates/course.html b/lms/templates/course.html index 37a25c7526..c22ff349ea 100644 --- a/lms/templates/course.html +++ b/lms/templates/course.html @@ -23,7 +23,7 @@
${course.get_about_section('university')} - 7/23/12 + ${course.start_date_text}
diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index ac7b5c5a49..51e769a3a4 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -23,12 +23,14 @@ + % if course.get_about_section("video"):
+ % endif @@ -66,7 +68,7 @@
    -
  1. Classes Start

    7/12/12
  2. +
  3. Classes Start

    ${course.start_date_text}
  4. ##
  5. Final Exam

    12/09/12
  6. ##
  7. Course Length

    15 weeks
  8. Course Number

    ${course.number}