Correctly encode and decode
This commit is contained in:
@@ -66,8 +66,9 @@ def clean_course_key(course_key, padding_char):
|
||||
padding_char (str): Character used for padding at end of the encoded
|
||||
string. The standard value for this is '='.
|
||||
"""
|
||||
encoded = b32encode(six.text_type(course_key).encode('utf8')).decode('utf8')
|
||||
return "course_{}".format(
|
||||
b32encode(six.text_type(course_key)).replace('=', padding_char)
|
||||
encoded.replace('=', padding_char)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user