Skip to content

Commit

Permalink
pr comment for field_mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
anishfyle committed Jul 30, 2024
1 parent 8727cfe commit fdd39df
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions apps/fyle/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ def sync_fyle_dimensions(workspace_id: int):

qbd_connection = PlatformConnector(workspace_id=workspace_id)
qbd_connection.sync_corporate_card()
field_mapping = FieldMapping.objects.filter(workspace_id=workspace_id).first()

sync_custom_field_options = False


if field_mapping:
if field_mapping.item_type == 'PROJECT':
qbd_connection.sync_projects(field_mapping.item_type)
elif field_mapping.item_type == 'COST_CENTER':
qbd_connection.sync_cost_center(field_mapping.item_type)
else:
sync_custom_field_options = True

qbd_connection.sync_custom_field(field_mapping.item_type, field_mapping, sync_custom_field_options)
field_mapping = FieldMapping.objects.filter(workspace_id=workspace_id).first()

sync_custom_field_options = False

if field_mapping:
if field_mapping.item_type == 'PROJECT':
qbd_connection.sync_projects(field_mapping.item_type)
elif field_mapping.item_type == 'COST_CENTER':
qbd_connection.sync_cost_center(field_mapping.item_type)
else:
sync_custom_field_options = True

qbd_connection.sync_custom_field(field_mapping.item_type, field_mapping, sync_custom_field_options)
else:
return

0 comments on commit fdd39df

Please sign in to comment.