From 32be5e39a1770d8e05d1a539df8288f7f416c555 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari <74908943+Hrishabh17@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:39:21 +0530 Subject: [PATCH] Fixed the None error in sync_method (#528) --- apps/mappings/queue.py | 2 +- apps/mappings/signals.py | 2 +- apps/netsuite/views.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/mappings/queue.py b/apps/mappings/queue.py index 51117746..141d662e 100644 --- a/apps/mappings/queue.py +++ b/apps/mappings/queue.py @@ -102,7 +102,7 @@ def construct_tasks_and_chain_import_fields_to_fyle(workspace_id: int): if mapping_settings: for mapping_setting in mapping_settings: if mapping_setting.source_field in ALLOWED_SOURCE_FIELDS or mapping_setting.is_custom: - destination_sync_methods = [SYNC_METHODS.get(mapping_setting.destination_field.upper()), 'custom_segments'] + destination_sync_methods = [SYNC_METHODS.get(mapping_setting.destination_field.upper(), 'custom_segments')] if mapping_setting.destination_field == 'PROJECT': destination_sync_methods.append(SYNC_METHODS['CUSTOMER']) diff --git a/apps/mappings/signals.py b/apps/mappings/signals.py index 07bbd9fa..e70a14bc 100644 --- a/apps/mappings/signals.py +++ b/apps/mappings/signals.py @@ -160,7 +160,7 @@ def run_pre_mapping_settings_triggers(sender, instance: MappingSetting, **kwargs destination_field=instance.destination_field, sync_after=last_successful_run_at, sdk_connection=netsuite_connection, - destination_sync_methods=[SYNC_METHODS.get(instance.destination_field.upper()), 'custom_segments'] + destination_sync_methods=[SYNC_METHODS.get(instance.destination_field.upper(), 'custom_segments')] ) fyle_credentials = FyleCredential.objects.get(workspace_id=workspace_id) diff --git a/apps/netsuite/views.py b/apps/netsuite/views.py index e8e9baed..c73a0a23 100644 --- a/apps/netsuite/views.py +++ b/apps/netsuite/views.py @@ -205,7 +205,7 @@ def post(self, request, *args, **kwargs): for mapping_setting in mapping_settings: if mapping_setting.source_field in ALLOWED_SOURCE_FIELDS or mapping_setting.is_custom: # run new_schedule_or_delete_fyle_import_tasks - destination_sync_methods = [SYNC_METHODS.get(mapping_setting.destination_field.upper()), 'custom_segments'] + destination_sync_methods = [SYNC_METHODS.get(mapping_setting.destination_field.upper(), 'custom_segments')] if mapping_setting.destination_field == 'PROJECT': destination_sync_methods.append(SYNC_METHODS['CUSTOMER'])