Fix server side AJAX template rendering

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-04-06 20:05:33 -04:00
parent 4d8dc8e552
commit 1eb9975dd6

View File

@@ -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