From c9881ca57df8ae7ec9f8655a0be81228565bf43d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 1 Jun 2024 11:22:12 +0000 Subject: [PATCH] audit changes --- .../management/commands/custom_runserver.py | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/kitchen_counter/conversion/management/commands/custom_runserver.py b/kitchen_counter/conversion/management/commands/custom_runserver.py index 22fe54a..2b4f700 100755 --- a/kitchen_counter/conversion/management/commands/custom_runserver.py +++ b/kitchen_counter/conversion/management/commands/custom_runserver.py @@ -186,6 +186,7 @@ def run_audit(msg): type="script-csv" ) hash2 = "" + hash2_docx = "" try: file_to_audit_docx = File.objects.get( script=script_id, @@ -194,9 +195,9 @@ def run_audit(msg): script_docx = {} script_path1 = file_to_audit_docx.file.path with open(script_path1, 'rb') as _file: - hash2 = uploadDataToIPFSNode(_file) + hash2_docx = uploadDataToIPFSNode(_file) script_docx["script_file_path"] = script_path1 - script_docx["script_file"] = hash2 + script_docx["script_file"] = hash2_docx script_docx["type"] = "script-docx" audit_data["script-docx"] = script_docx except: @@ -226,9 +227,9 @@ def run_audit(msg): script_path1 = file_to_audit_docx.file.path script_size = file_to_audit_docx.file.size with open(script_path1, 'rb') as _file: - hash2 = uploadDataToIPFSNode(_file) + hash2_docx = uploadDataToIPFSNode(_file) script_docx["script_file_path"] = script_path1 - script_docx["script_file"] = hash2 + script_docx["script_file"] = hash2_docx script_docx["type"] = "script-docx" audit_data["script-docx"] = script_docx @@ -309,14 +310,14 @@ def run_audit(msg): print("$$$$### after sendmail") # user_infos = user_info(tx_hash=Response,service="Script Audit",gas_fee=gasprice) # addition_result = user_infos.update_info(request) - hash2 = hash_decrypation(hash2) + hash2_docx = hash_decrypation(hash2_docx) tx_id = Response certificate = certificateGenrate(user.username,"script audit",tx_id,projectname=script_file_name,matic=gasprice) to_email = [user.email] email_code = 'BL1' key_value = { "service":"Audited Script", - "hash": hash2, + "hash": hash2_docx, "public key":blockchain_obj.publicKey, "Transaction Hash": tx_id, } @@ -336,6 +337,7 @@ def run_audit(msg): type="audit-report" ) hash2 = "" + hash2_docx = "" try: file_to_audit_docx = File.objects.get( script=script_id, @@ -344,9 +346,9 @@ def run_audit(msg): script_docx = {} script_path1 = file_to_audit_docx.file.path with open(script_path1, 'rb') as _file: - hash2 = uploadDataToIPFSNode(_file) + hash2_docx = uploadDataToIPFSNode(_file) script_docx["script_file_path"] = script_path1 - script_docx["script_file"] = hash2 + script_docx["script_file"] = hash2_docx script_docx["type"] = "script-docx" audit_data["script-docx"] = script_docx except: @@ -376,9 +378,9 @@ def run_audit(msg): script_path1 = file_to_audit_docx.file.path script_size = file_to_audit_docx.file.size with open(script_path1, 'rb') as _file: - hash2 = uploadDataToIPFSNode(_file) + hash2_docx = uploadDataToIPFSNode(_file) script_docx["script_file_path"] = script_path1 - script_docx["script_file"] = hash2 + script_docx["script_file"] = hash2_docx script_docx["type"] = "script-docx" audit_data["script-docx"] = script_docx @@ -469,14 +471,14 @@ def run_audit(msg): # user_infos = user_info(tx_hash=Response,service="Script Audit",gas_fee=gasprice) # addition_result = user_infos.update_info(request) - hash2 = hash_decrypation(hash2) + hash2_docx = hash_decrypation(hash2_docx) tx_id = Response certificate = certificateGenrate(user.username,"script audit",tx_id,projectname=script_file_name,matic=gasprice) to_email = [user.email] email_code = 'BL1' key_value = { "service":"Audited Script", - "hash": hash2, + "hash": hash2_docx, "public key":blockchain_obj.publicKey, "Transaction Hash": tx_id, }