EDUCATOR-3 Check for course before using it.
This commit is contained in:
@@ -7,7 +7,7 @@ import logging
|
||||
from django.conf import settings
|
||||
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
from contentstore.views.helpers import is_item_in_course_tree
|
||||
|
||||
from edx_proctoring.api import (
|
||||
@@ -40,6 +40,9 @@ def register_special_exams(course_key):
|
||||
return
|
||||
|
||||
course = modulestore().get_course(course_key)
|
||||
if course is None:
|
||||
raise ItemNotFoundError("Course {} does not exist", unicode(course_key))
|
||||
|
||||
if not course.enable_proctored_exams and not course.enable_timed_exams:
|
||||
# likewise if course does not have these features turned on
|
||||
# then quickly exit
|
||||
|
||||
Reference in New Issue
Block a user