Skip to content

Commit

Permalink
Handle refresh dimension safely for new customers (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Dec 27, 2023
1 parent ab01a95 commit f77a41a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/quickbooks_online/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ def refresh_quickbooks_dimensions(workspace_id: int):

mapping_settings = MappingSetting.objects.filter(workspace_id=workspace_id, import_to_fyle=True)
credentials = QBOCredential.objects.get(workspace_id=workspace_id)
workspace_general_settings = WorkspaceGeneralSettings.objects.get(workspace_id=workspace_id)
workspace_general_settings = WorkspaceGeneralSettings.objects.filter(workspace_id=workspace_id).first()

chain = Chain()

for mapping_setting in mapping_settings:
if mapping_setting.source_field in ['PROJECT', 'COST_CENTER'] or mapping_setting.is_custom:
if workspace_general_settings and mapping_setting.source_field in ['PROJECT', 'COST_CENTER'] or mapping_setting.is_custom:
chain.append(
'fyle_integrations_imports.tasks.trigger_import_via_schedule',
workspace_id,
Expand Down

0 comments on commit f77a41a

Please sign in to comment.