some pravesh conversion changes #4
|
@ -422,33 +422,37 @@ class Conversion:
|
|||
if obj.User_preference !="MNF":
|
||||
tx_id, tx_gas_fee = UploadConversionData(OWNER_KEY, blockchain_obj.publicKey, UserId, str(Project),
|
||||
Data)
|
||||
if tx_id == False:
|
||||
obj.User_preference = "MNF"
|
||||
obj.save()
|
||||
else:
|
||||
|
||||
print("Tx id -> ", tx_id,tx_gas_fee)
|
||||
print(type(tx_id))
|
||||
print("Tx id -> ", tx_id,tx_gas_fee)
|
||||
print(type(tx_id))
|
||||
|
||||
|
||||
|
||||
try:
|
||||
user_infos = user_info(tx_hash=tx_id, service="Conversion", gas_fee=tx_gas_fee,
|
||||
script_name=self.name_script)
|
||||
addition_result = user_infos.update_info(self)
|
||||
print("Blockchain Result -> ",addition_result)
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
try:
|
||||
user_infos = user_info(tx_hash=tx_id, service="Conversion", gas_fee=tx_gas_fee,
|
||||
script_name=self.name_script)
|
||||
addition_result = user_infos.update_info(self)
|
||||
print("Blockchain Result -> ",addition_result)
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
|
||||
print("blockchain script conversion 6")
|
||||
# certificatepath = certificateGenrate(self.user.username, "script conversion", hash)
|
||||
certificatepath = certificateGenrate(self.user.username, "script conversion", hash, projectname=self.name_script, matic = tx_gas_fee)
|
||||
hash = hash_decrypation(hash)
|
||||
to_email = [self.user.email]
|
||||
email_code = 'BL1'
|
||||
|
||||
key_value = {
|
||||
"Product Name": "script conversion",
|
||||
"Profile url": f"{settings.SITE_DOMAIN}/memberpage/#/personaldetails",
|
||||
"User url": f"{settings.SITE_DOMAIN}/memberpage/#/user/{self.user.id}/personaldetails",
|
||||
"Product output card url": f"{settings.SITE_DOMAIN}/conversion/view_conversion/",
|
||||
}
|
||||
sendmail(to_email=to_email, email_code=email_code,key_value=key_value, filePath=certificatepath)
|
||||
print("blockchain script conversion 6")
|
||||
# certificatepath = certificateGenrate(self.user.username, "script conversion", hash)
|
||||
certificatepath = certificateGenrate(self.user.username, "script conversion", hash, projectname=self.name_script, matic = tx_gas_fee)
|
||||
hash = hash_decrypation(hash)
|
||||
to_email = [self.user.email]
|
||||
email_code = 'BL1'
|
||||
|
||||
key_value = {
|
||||
"Product Name": "script conversion",
|
||||
"Profile url": f"{settings.SITE_DOMAIN}/memberpage/#/personaldetails",
|
||||
"User url": f"{settings.SITE_DOMAIN}/memberpage/#/user/{self.user.id}/personaldetails",
|
||||
"Product output card url": f"{settings.SITE_DOMAIN}/conversion/view_conversion/",
|
||||
}
|
||||
sendmail(to_email=to_email, email_code=email_code,key_value=key_value, filePath=certificatepath)
|
||||
except Exception as e:
|
||||
self.translated_script_object.error_desc = "Error in blockchain is " + str(e)
|
||||
self.translated_script_object.save()
|
||||
|
|
Loading…
Reference in New Issue