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

This commit is contained in:
Don Mitchell
2014-05-06 11:17:38 -04:00
parent c056891332
commit 03c9b01213

View File

@@ -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("+", "/")