diff --git a/frappe/core/doctype/transaction_log/transaction_log.py b/frappe/core/doctype/transaction_log/transaction_log.py index b5803aca4a..5110ae0931 100644 --- a/frappe/core/doctype/transaction_log/transaction_log.py +++ b/frappe/core/doctype/transaction_log/transaction_log.py @@ -29,12 +29,19 @@ class TransactionLog(Document): def hash_line(self): sha = hashlib.sha256() - sha.update(str(self.row_index) + str(self.timestamp) + str(self.data)) + sha.update( + frappe.safe_encode(str(self.row_index)) + \ + frappe.safe_encode(str(self.timestamp)) + \ + frappe.safe_encode(str(self.data)) + ) return sha.hexdigest() def hash_chain(self): sha = hashlib.sha256() - sha.update(str(self.transaction_hash) + str(self.previous_hash)) + sha.update( + frappe.safe_encode(str(self.transaction_hash)) + \ + frappe.safe_encode(str(self.previous_hash)) + ) return sha.hexdigest()