Skip to content

Commit 8479d25

Browse files
committed
EditorLink.available_exams: cope with JSON decode error
1 parent 38d6eb2 commit 8479d25

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

numbas_lti/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,10 @@ def available_exams(self):
19391939
from . import tasks
19401940
tasks.editorlink_update_cache(self)
19411941
if self.cached_available_exams:
1942-
return json.loads(self.cached_available_exams)
1942+
try:
1943+
return json.loads(self.cached_available_exams)
1944+
except json.JSONDecodeError:
1945+
return []
19431946
else:
19441947
return []
19451948

0 commit comments

Comments
 (0)