From 201ce76ecd1e26dfe10073df3243c43a65c433a7 Mon Sep 17 00:00:00 2001 From: Ashutosh619-sudo Date: Wed, 9 Oct 2024 21:09:14 +0530 Subject: [PATCH] feat: Adding loggers for workspaces api --- apps/workspaces/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/workspaces/views.py b/apps/workspaces/views.py index 1f2ea7b5..8a4c3481 100644 --- a/apps/workspaces/views.py +++ b/apps/workspaces/views.py @@ -60,14 +60,17 @@ def get(self, request): user = User.objects.get(user_id=request.user) org_id = request.query_params.get('org_id') workspaces = Workspace.objects.filter(user__in=[user], fyle_org_id=org_id).all() - + logger.info('User id %s', request.user) if workspaces: + logger.info('Workspace detail %s', workspaces[0].__dict__) async_task( "apps.workspaces.tasks.async_update_workspace_name", workspaces[0], request.META.get("HTTP_AUTHORIZATION"), q_options={'cluster': 'import'} ) + else: + logger.info('No workspace found for user %s with org_id %s', request.user, org_id) return Response(data=WorkspaceSerializer(workspaces, many=True).data, status=status.HTTP_200_OK)