diff --git a/mayan/apps/common/classes.py b/mayan/apps/common/classes.py index 1d1db0b597..6f40916148 100644 --- a/mayan/apps/common/classes.py +++ b/mayan/apps/common/classes.py @@ -305,10 +305,10 @@ class Template(object): context=context, ).render() - content = result.rendered_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