diff --git a/lms/djangoapps/grades/models.py b/lms/djangoapps/grades/models.py index a287f4d314..a0e398976d 100644 --- a/lms/djangoapps/grades/models.py +++ b/lms/djangoapps/grades/models.py @@ -79,7 +79,7 @@ class BlockRecordList(object): supported by adding a label indicated which algorithm was used, e.g., "sha256$j0NDRmSPa5bfid2pAcUXaxCm2Dlh3TwayItZstwyeqQ=". """ - return b64encode(sha1(self.json_value).digest()) + return b64encode(sha1(self.json_value.encode('utf-8')).digest()) @lazy def json_value(self): diff --git a/lms/djangoapps/grades/transformer.py b/lms/djangoapps/grades/transformer.py index a959e583f5..7470c8ac91 100644 --- a/lms/djangoapps/grades/transformer.py +++ b/lms/djangoapps/grades/transformer.py @@ -93,7 +93,7 @@ class GradesTransformer(BlockStructureTransformer): separators=(',', ':'), # Remove spaces from separators for more compact representation sort_keys=True, ) - return b64encode(sha1(ordered_policy).digest()) + return b64encode(sha1(ordered_policy.encode('utf-8')).digest()) @classmethod def _collect_explicit_graded(cls, block_structure):