Fix byte encoding of Grades hashes
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user