From 75e9ef12b6ece40da84ee68914eac022c0de16b3 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 18 Jul 2012 15:53:24 -0400 Subject: [PATCH 1/2] The dashboard links to the about page for courses that haven't started yet. --- lms/templates/dashboard.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index caf28d920b..2c61770371 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -36,14 +36,20 @@ % for course in courses:
- + <% + if course.has_started(): + course_target = reverse('info', args=[course.id]) + else: + course_target = reverse('about_course', args=[course.id]) + %> +
${get_course_about_section(course, 'university')} -

${get_course_about_section(course, "title")}

+

${get_course_about_section(course, "title")}

Class Starts - 9/2/2012 From a9078ac0b079662c1c9ec61c6713eecea792521a Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 18 Jul 2012 16:00:03 -0400 Subject: [PATCH 2/2] check_course didn't have the right exception being caught. --- lms/djangoapps/courseware/courses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 7bf3cd729f..688da8d98e 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -8,6 +8,7 @@ from django.http import Http404 from xmodule.course_module import CourseDescriptor from xmodule.modulestore.django import modulestore +from xmodule.modulestore.exceptions import ItemNotFoundError log = logging.getLogger(__name__) @@ -29,7 +30,7 @@ def check_course(course_id, course_must_be_open=True, course_required=True): try: course_loc = CourseDescriptor.id_to_location(course_id) course = modulestore().get_item(course_loc) - except KeyError: + except (KeyError, ItemNotFoundError): raise Http404("Course not found.") if course_must_be_open and not course.has_started():