Commit 03c9b012 by Don Mitchell

fixup! Make course ids and usage ids opaque to LMS and Studio [partial commit]

parent c0568913
......@@ -36,6 +36,14 @@ class SlashSeparatedCourseKey(CourseKey):
KEY_FIELDS = ('org', 'course', 'run')
__slots__ = KEY_FIELDS
def __init__(self, org, course, run):
"""
checks that the values are syntactically valid before creating object
"""
for part in (org, course, run):
LocationBase._check_location_part(part, INVALID_CHARS)
super(SlashSeparatedCourseKey, self).__init__(org, course, run)
@classmethod
def _from_string(cls, serialized):
serialized = serialized.replace("+", "/")
......
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