From b60d6b632b5567d495f810fa7b5008e7d5b1fc32 Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Sat, 15 Sep 2012 05:02:28 -0700 Subject: [PATCH] Try and find a run-specific syllabus before loading a course-specific syllabus --- lms/djangoapps/courseware/courses.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 4383396678e2..65a1eee25bd3 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -195,7 +195,11 @@ def get_course_syllabus_section(course, section_key): if section_key in ['syllabus', 'guest_syllabus']: try: - with course.system.resources_fs.open(path("syllabus") / section_key + ".html") as htmlFile: + fs = course.system.resources_fs + # first look for a run-specific version + dirs = [path("syllabus") / course.url_name, path("syllabus")] + filepath = find_file(fs, dirs, section_key + ".html") + with fs.open(filepath) as htmlFile: return replace_urls(htmlFile.read().decode('utf-8'), course.metadata['data_dir']) except ResourceNotFoundError: