Django2 bulk_email: bytestring conversion

This commit is contained in:
Nimisha Asthagiri
2020-03-31 16:04:45 -04:00
parent b1baf5db77
commit 90a330d0ad

View File

@@ -35,9 +35,8 @@ def opt_out_email_updates(request, token, course_id):
Raises a 404 if there are any errors parsing the input.
"""
try:
username = UsernameCipher().decrypt(token)
username = UsernameCipher().decrypt(token).decode("utf-8")
user = User.objects.get(username=username)
course_key = CourseKey.from_string(course_id)
course = get_course_by_id(course_key, depth=0)