custom runserver audit changes

This commit is contained in:
Ubuntu 2024-05-11 02:26:37 +00:00
parent 0a96bc224a
commit c42c519808
1 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,10 @@ from users.models import UserCredentialsForBlockchain
from django.core.files.base import File as DjangoFile from django.core.files.base import File as DjangoFile
import tempfile import tempfile
from io import BytesIO from io import BytesIO
from auto_email.views import sendmail
from lpp.certificate.createCertificate import certificateGenrate
basePath = BasePath() basePath = BasePath()
User = get_user_model() User = get_user_model()
@ -303,6 +307,10 @@ def run_audit(msg):
status.transaction_hash =str(transactioni_id) status.transaction_hash =str(transactioni_id)
status.save() 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) # user_infos = user_info(tx_hash=Response,service="Script Audit",gas_fee=gasprice)
# addition_result = user_infos.update_info(request) # addition_result = user_infos.update_info(request)
hash2 = hash_decrypation(hash2) hash2 = hash_decrypation(hash2)
@ -349,6 +357,10 @@ def run_audit(msg):
else: 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)) Response = UploadScriptAuditData(OWNER_KEY,blockchain_obj.publicKey,blockchain_obj.user_id,script_id,str(audit_data))
print("tx_hash",Response) print("tx_hash",Response)
@ -367,6 +379,8 @@ def run_audit(msg):
"private key":userkey, "private key":userkey,
"Transaction Hash": tx_id, "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("::::::::::::::",key_value)
print("userkey = ", userkey) print("userkey = ", userkey)