Commit b8ae026c by ichuang

fail gracefully if course.xml missing metadata in course_staff_group_name

parent d50af576
......@@ -117,7 +117,10 @@ def get_course_info_section(course, section_key):
raise KeyError("Invalid about key " + str(section_key))
def course_staff_group_name(course):
return 'staff_%s' % course.metadata['course']
coursename = course.metadata.get('course','')
if not coursename: # Fall 2012: not all course.xml have metadata correct yet
coursename = course.metadata.get('data_dir','UnknownCourseName')
return 'staff_%s' % coursename
def has_staff_access_to_course(user,course):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment