Merge pull request #21874 from edx/BOM-804

BOM-804
This commit is contained in:
Ayub
2019-10-14 12:30:18 +05:00
committed by GitHub

View File

@@ -119,7 +119,7 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
orig_name = orig_name[len(tag) + 1:-12]
# append the hash of the content--the first 12 bytes should be plenty.
orig_name = "_" + orig_name if orig_name not in (None, "") else ""
xml_bytes = xml.encode('utf8')
xml_bytes = xml if isinstance(xml, bytes) else xml.encode('utf-8')
return tag + orig_name + "_" + hashlib.sha1(xml_bytes).hexdigest()[:12]
# Fallback if there was nothing we could use: