Use bytes for hash and return the unicode

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-04 22:03:19 -04:00
parent 49403978b1
commit 51ea493a26

View File

@@ -405,10 +405,10 @@ class Template(object):
context=context,
).render()
content = result.content.replace('\n', '')
self.html = content
self.hex_hash = hashlib.sha256(content).hexdigest()
# Calculate the hash of the bytes version but return the unicode
# version
self.html = result.rendered_content.replace('\n', '')
self.hex_hash = hashlib.sha256(result.content).hexdigest()
return self