Skip to content

Commit

Permalink
Try and find a run-specific syllabus before loading a course-specific…
Browse files Browse the repository at this point in the history
… syllabus
  • Loading branch information
arjun810 committed Sep 15, 2012
1 parent 06b9f0c commit b60d6b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lms/djangoapps/courseware/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b60d6b6

Please sign in to comment.