Commit 69390152 by David Ormsbee Committed by Calen Pennington

Instead of calculating the course's usage key, just follow the parent chain.

parent abcdc05a
......@@ -66,11 +66,13 @@ class DiscussionModule(DiscussionFields, XModule):
def get_course(self):
"""
Return the CourseDescriptor by course id.
Return the CourseDescriptor at the root of the tree we're in.
"""
course_key = self.location.course_key
root_course_loc = course_key.make_usage_key(u'course', u'course')
return self.runtime.get_block(root_course_loc)
block = self
while block.parent:
block = block.get_parent()
return block
class DiscussionDescriptor(DiscussionFields, MetadataOnlyEditingDescriptor, RawDescriptor):
......
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