Commit a9078ac0 by Bridger Maxwell

check_course didn't have the right exception being caught.

parent 75e9ef12
......@@ -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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment