From 52102bea51835459c5487bdcbda96df001d26b24 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 14 May 2024 06:30:02 +0000 Subject: [PATCH] blockchain certifcate, custom_runserver changes and conversion existing juggernaut error resolved --- .../conversion/management/commands/custom_runserver.py | 2 +- .../conversion/translation/external_conversion.py | 5 +++++ kitchen_counter/lpp/certificate/createCertificate.py | 2 +- .../lpp/templates/lpp/blockchainCertificate.html | 8 ++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/kitchen_counter/conversion/management/commands/custom_runserver.py b/kitchen_counter/conversion/management/commands/custom_runserver.py index 2287287..22fe54a 100755 --- a/kitchen_counter/conversion/management/commands/custom_runserver.py +++ b/kitchen_counter/conversion/management/commands/custom_runserver.py @@ -57,7 +57,7 @@ def run_conversion(msg): "original_script_id": translated_script.script_link_id.script_id, "translated_script_id": translated_script.translation_id, "sample_id": body_dict.get('sample_id', None), - "existing_script": body_dict.get('sample_id', None), + "existing_script": body_dict.get('existing_script', None), "iteration_no": body_dict.get('iteration_no', None), "juggernaut_pages_deduction": body_dict.get("juggernaut_pages_deduction", None), "language_set": body_dict.get("language_set", None), diff --git a/kitchen_counter/conversion/translation/external_conversion.py b/kitchen_counter/conversion/translation/external_conversion.py index 2a6ac32..c341657 100644 --- a/kitchen_counter/conversion/translation/external_conversion.py +++ b/kitchen_counter/conversion/translation/external_conversion.py @@ -461,6 +461,8 @@ class Conversion: conversion_pages=self.juggernaut_pages_deduction, associated_project=self.original_script_object, translation_language=self.language_set) + self.original_script_object = MNFScriptDatabase.objects.get( + script_id=conversion_params['original_script_id']) self.original_script_object.is_juggernaut_used = True # if script_original.languages_juggernaut != "": # # script_original.languages_juggernaut = str(script_original.languages_juggernaut) + "," + str( @@ -644,7 +646,10 @@ class Conversion: """Process Completed""" + self.translated_script_object = ScriptTranslations.objects.get( + translation_id=self.translated_script_object.translation_id) self.translated_script_object.status = "Completed" + try: self.translated_script_object.blockchain_txhash = tx_id self.translated_script_object.translated_script_pdf = s3_url diff --git a/kitchen_counter/lpp/certificate/createCertificate.py b/kitchen_counter/lpp/certificate/createCertificate.py index c26dd3f..a0d928f 100755 --- a/kitchen_counter/lpp/certificate/createCertificate.py +++ b/kitchen_counter/lpp/certificate/createCertificate.py @@ -51,7 +51,7 @@ def certificateGenrate(name,file_from,Hash,projectname="NAN",matic=0): 'enable-local-file-access': '' } pdfkit.from_string( - html, f'{basepath}/lpp/certificate/certificate.pdf', options=options) + html, f'{basepath}/lpp/certificate/certificate.pdf', options=options,verbose=True) return f'{basepath}/lpp/certificate/certificate.pdf' # certificateGenrate("pravesh yadav","PPT Conversiom", "qwefgfdsdfgdsdcvxs") diff --git a/kitchen_counter/lpp/templates/lpp/blockchainCertificate.html b/kitchen_counter/lpp/templates/lpp/blockchainCertificate.html index 2e94bb6..2257891 100755 --- a/kitchen_counter/lpp/templates/lpp/blockchainCertificate.html +++ b/kitchen_counter/lpp/templates/lpp/blockchainCertificate.html @@ -15,14 +15,14 @@
- +
- v-line @@ -36,7 +36,7 @@ - v-line @@ -124,7 +124,7 @@
- doodle