From c42c519808c9a4c4d152dff4a6fe099b8c6137f9 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 11 May 2024 02:26:37 +0000 Subject: [PATCH] custom runserver audit changes --- .../management/commands/custom_runserver.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kitchen_counter/conversion/management/commands/custom_runserver.py b/kitchen_counter/conversion/management/commands/custom_runserver.py index 91549e9..7968090 100755 --- a/kitchen_counter/conversion/management/commands/custom_runserver.py +++ b/kitchen_counter/conversion/management/commands/custom_runserver.py @@ -21,6 +21,10 @@ from users.models import UserCredentialsForBlockchain from django.core.files.base import File as DjangoFile import tempfile from io import BytesIO +from auto_email.views import sendmail +from lpp.certificate.createCertificate import certificateGenrate + + basePath = BasePath() User = get_user_model() @@ -303,6 +307,10 @@ def run_audit(msg): status.transaction_hash =str(transactioni_id) status.save() + to_email = [user.email] + email_code = 'SB1' + sendmail(to_email=to_email , email_code=email_code) + # user_infos = user_info(tx_hash=Response,service="Script Audit",gas_fee=gasprice) # addition_result = user_infos.update_info(request) hash2 = hash_decrypation(hash2) @@ -349,6 +357,10 @@ def run_audit(msg): else: + + to_email = [user.email] + email_code = 'SB2' + sendmail(to_email=to_email , email_code=email_code) Response = UploadScriptAuditData(OWNER_KEY,blockchain_obj.publicKey,blockchain_obj.user_id,script_id,str(audit_data)) print("tx_hash",Response) @@ -367,6 +379,8 @@ def run_audit(msg): "private key":userkey, "Transaction Hash": tx_id, } + certificate = certificateGenrate(user.username,"script audit",tx_id,projectname=script_file_name,matic=gasprice) + sendmail(to_email=to_email , email_code=email_code, key_value=key_value, filePath=certificate) print("::::::::::::::",key_value) print("userkey = ", userkey)