From aaf7ddd3f3339640ca022f099888468b89edfda0 Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Mon, 19 Aug 2019 16:08:38 -0400 Subject: [PATCH] Correctly encode and decode --- common/lib/xmodule/xmodule/course_metadata_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_metadata_utils.py b/common/lib/xmodule/xmodule/course_metadata_utils.py index faa43f37b3..c862356513 100644 --- a/common/lib/xmodule/xmodule/course_metadata_utils.py +++ b/common/lib/xmodule/xmodule/course_metadata_utils.py @@ -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) )