diff --git a/backend/tasks/views.py b/backend/tasks/views.py index 98a26178..35fdd801 100644 --- a/backend/tasks/views.py +++ b/backend/tasks/views.py @@ -2479,19 +2479,19 @@ def get_celery_tasks(request): for i in filtered_tasks: if filtered_tasks[i]["succeeded"] is not None: filtered_tasks[i]["succeeded"] = datetime.fromtimestamp( - filtered_tasks[i]["succeeded"], tz=timezone.utc + filtered_tasks[i]["succeeded"],tz=timezone.utc ).strftime("%Y-%m-%dT%H:%M:%S.%fZ") if filtered_tasks[i]["failed"] is not None: filtered_tasks[i]["failed"] = datetime.fromtimestamp( - filtered_tasks[i]["failed"], tz=timezone.utc + filtered_tasks[i]["failed"],tz=timezone.utc ).strftime("%Y-%m-%dT%H:%M:%S.%fZ") if filtered_tasks[i]["started"] is not None: filtered_tasks[i]["started"] = datetime.fromtimestamp( - filtered_tasks[i]["started"], tz=timezone.utc + filtered_tasks[i]["started"],tz=timezone.utc ).strftime("%Y-%m-%dT%H:%M:%S.%fZ") if filtered_tasks[i]["received"] is not None: filtered_tasks[i]["received"] = datetime.fromtimestamp( - filtered_tasks[i]["received"], tz=timezone.utc + filtered_tasks[i]["received"],tz=timezone.utc ).strftime("%Y-%m-%dT%H:%M:%S.%fZ") if "error" in filtered_tasks: diff --git a/backend/workspaces/views.py b/backend/workspaces/views.py index 31fc86cd..df717f61 100644 --- a/backend/workspaces/views.py +++ b/backend/workspaces/views.py @@ -161,7 +161,10 @@ def list_guest_workspaces(self, request): try: # Filter workspaces where guest_workspace is True guest_workspaces = Workspace.objects.filter(guest_workspace=True) + authenticated_workspaces = guest_workspaces.filter(members=request.user) serializer = WorkspaceSerializer(guest_workspaces, many=True) + for workspace in serializer.data: + workspace["is_autheticated"]= workspace["id"] in authenticated_workspaces.values_list("id",flat=True) return Response(serializer.data, status=status.HTTP_200_OK) except Exception as e: return Response(