Skip to content

Commit

Permalink
Merge branch 'master' into max-export-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo committed Aug 23, 2024
2 parents ab35ef4 + 09329ad commit 4f92acb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/netsuite/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .serializers import NetSuiteFieldSerializer, CustomSegmentSerializer
from .tasks import create_vendor_payment, check_netsuite_object_status, process_reimbursements
from .models import CustomSegment
from .helpers import check_interval_and_sync_dimension, sync_dimensions
from .helpers import check_interval_and_sync_dimension, handle_refresh_dimensions, sync_dimensions
from apps.workspaces.actions import export_to_netsuite

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -184,7 +184,11 @@ def post(self, request, *args, **kwargs):
workspace = Workspace.objects.get(pk=kwargs['workspace_id'])
NetSuiteCredentials.objects.get(workspace_id=workspace.id)

async_task('apps.netsuite.helpers.handle_refresh_dimensions', kwargs['workspace_id'], dimensions_to_sync)
# If only specified dimensions are to be synced, sync them synchronously
if dimensions_to_sync:
handle_refresh_dimensions(kwargs['workspace_id'], dimensions_to_sync)
else:
async_task('apps.netsuite.helpers.handle_refresh_dimensions', kwargs['workspace_id'], dimensions_to_sync)

return Response(
status=status.HTTP_200_OK
Expand Down

0 comments on commit 4f92acb

Please sign in to comment.