From 8670b9977a234bc745deeb619e25ab7e119942a7 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Tue, 20 Mar 2018 20:08:00 +0530 Subject: [PATCH] Fixed transaction_log test case --- .../core/doctype/transaction_log/transaction_log.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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()