From 602435fc60fcf5ea8379a8d41d9202c54e812c86 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Mon, 14 Jan 2013 11:38:34 -0500 Subject: [PATCH] Don't break the course if the grading policy is broken --- common/lib/xmodule/xmodule/course_module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 8b4db799cb..0c854a8036 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -228,7 +228,11 @@ class CourseDescriptor(SequenceDescriptor): if policy_dir: paths = [policy_dir + '/grading_policy.json'] + paths - policy = json.loads(cls.read_grading_policy(paths, system)) + try: + policy = json.loads(cls.read_grading_policy(paths, system)) + except ValueError: + system.error_tracker("Unable to decode grading policy as json") + policy = None # cdodge: import the grading policy information that is on disk and put into the # descriptor 'definition' bucket as a dictionary so that it is persisted in the DB