From 6e15d10fd0c3420d8051e52cfc4fb4d3c9335e03 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 15 Jun 2024 12:00:00 +0000 Subject: [PATCH] CFD issues of translation failing and audit user changed to Brainstorm --- .../management/commands/custom_runserver.py | 3 ++- .../conversion/translation/external_conversion.py | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/kitchen_counter/conversion/management/commands/custom_runserver.py b/kitchen_counter/conversion/management/commands/custom_runserver.py index 2b4f700..07e4176 100755 --- a/kitchen_counter/conversion/management/commands/custom_runserver.py +++ b/kitchen_counter/conversion/management/commands/custom_runserver.py @@ -50,8 +50,9 @@ def run_conversion(msg): ) s3_client.download_file("conversion-kitchen", object_key, local_file_path) - + audit_user = User.objects.get(id=1) conversion_params = { + "audit_user": audit_user, "user": translated_script.user_id, "file_path": str(basePath) + "/media/" + translated_script.script_link_id.script.name, "original_script_id": translated_script.script_link_id.script_id, diff --git a/kitchen_counter/conversion/translation/external_conversion.py b/kitchen_counter/conversion/translation/external_conversion.py index 3e81914..48372b6 100644 --- a/kitchen_counter/conversion/translation/external_conversion.py +++ b/kitchen_counter/conversion/translation/external_conversion.py @@ -42,6 +42,7 @@ basePath = BasePath() class Conversion: def __init__(self, **conversion_params): + self.audit_user = conversion_params['audit_user'] self.user = conversion_params['user'] self.file_path = conversion_params['file_path'] self.original_script_object = MNFScriptDatabase.objects.get( @@ -122,8 +123,8 @@ class Conversion: ) language_code = "en" result = filesystem.new_screenplay_without_audit_in_background( - self.user, - self.user.username, + self.audit_user, + self.audit_user.username, str(self.name_script), file, "script-original", @@ -216,8 +217,8 @@ class Conversion: ) language_code = "en" result = filesystem.new_screenplay_without_audit_in_background( - self.user, - self.user.username, + self.audit_user, + self.audit_user.username, str(self.name_script), file, "script-original", @@ -307,8 +308,8 @@ class Conversion: language_code = "en" unique_str = "_" + str(int(time.time())) result = filesystem.new_screenplay_without_audit_in_background( - self.user, - self.user.username, + self.audit_user, + self.audit_user.username, str(self.name_script)+str(unique_str), file, "script-original",