Skip to content

Commit

Permalink
Merge pull request #129 from AI4Bharat/Rahul-540
Browse files Browse the repository at this point in the history
Rahul 540
  • Loading branch information
ishvindersethi22 authored Dec 20, 2024
2 parents b0f5210 + 0411e22 commit 2c1f3ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/tasks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions backend/workspaces/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2c1f3ca

Please sign in to comment.