Compare commits
No commits in common. "d698166fcbecb2e224094f2e0d055971dc108c91" and "a38fa230f2904b18a90dda4c2490e71a08252deb" have entirely different histories.
d698166fcb
...
a38fa230f2
|
@ -22,8 +22,6 @@ from io import BytesIO
|
|||
from auto_email.views import sendmail
|
||||
from lpp.certificate.createCertificate import certificateGenrate
|
||||
from scriptAudit.utils import update_audit_status
|
||||
from Blockchain2.models import MNFServersFile
|
||||
from django.core.files import File as File2
|
||||
# from django.conf import settings
|
||||
|
||||
basePath = BasePath()
|
||||
|
@ -301,14 +299,12 @@ def lpp_audit(msg):
|
|||
print("blockchain script conversion 3", uploaded_script, translated_scripttt)
|
||||
with open(uploaded_script, 'rb') as f:
|
||||
hash = uploadDataToIPFSNode(f)
|
||||
savefiles(f, uploaded_script, obj.translation_id,"original_scriptFile_hash")
|
||||
scriptconversion["original_scriptFile_hash"] = hash
|
||||
scriptconversion["original_scriptFile_path"] = uploaded_script
|
||||
scriptconversion["date_at"] = current_datetime.strftime("%Y-%m-%d %H:%M:%S")
|
||||
print("blockchain script conversion 4")
|
||||
with open(translated_scripttt, 'rb') as f1:
|
||||
hash = uploadDataToIPFSNode(f1)
|
||||
savefiles(f1, translated_scripttt, obj.translation_id,"translated_scriptFile_hash")
|
||||
scriptconversion["translated_scriptFile_hash"] = hash
|
||||
scriptconversion["translated_scriptFile_path"] = translated_scripttt
|
||||
print("blockchain script conversion 5")
|
||||
|
@ -343,7 +339,6 @@ def lpp_audit(msg):
|
|||
# script_size = file_to_audit_docx.file.size
|
||||
with open(script_path1, 'rb') as _file:
|
||||
hash2 = uploadDataToIPFSNode(_file)
|
||||
savefiles(_file, script_path1, obj.translation_id,"script-json")
|
||||
print(f"hash2 is ---> {hash2}")
|
||||
script_json["script_file_path"] = script_path1
|
||||
script_json["script_file"] = hash2
|
||||
|
@ -519,13 +514,3 @@ class Command(BaseCommand):
|
|||
break
|
||||
|
||||
print("Completed All Execution")
|
||||
|
||||
|
||||
def savefiles(file, path, script_id,File_type):
|
||||
filename = os.path.basename(path)
|
||||
django_file = File2(file)
|
||||
files, _ = MNFServersFile.objects.get_or_create(
|
||||
project_id= script_id,
|
||||
file_type=File_type,
|
||||
)
|
||||
files.public_file.save(filename, django_file)
|
||||
|
|
Loading…
Reference in New Issue