Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

chore: workspace estimate project filter (#4070)

Bavisetti Narayan1c3619a4d6d7
diff --git a/apiserver/plane/app/views/workspace/estimate.py b/apiserver/plane/app/views/workspace/estimate.py
index fa75d5b88e..8ca24efd74 100644
--- a/apiserver/plane/app/views/workspace/estimate.py
+++ b/apiserver/plane/app/views/workspace/estimate.py
@@ -25,15 +25,11 @@ class WorkspaceEstimatesEndpoint(BaseAPIView):
estimate_ids = Project.objects.filter(
workspace__slug=slug, estimate__isnull=False
).values_list("estimate_id", flat=True)
- estimates = Estimate.objects.filter(
- pk__in=estimate_ids
- ).prefetch_related(
- Prefetch(
- "points",
- queryset=Project.objects.select_related(
- "estimate", "workspace"
- ),
- )
+ estimates = (
+ Estimate.objects.filter(pk__in=estimate_ids, workspace__slug=slug)
+ .prefetch_related("points")
+ .select_related("workspace", "project")
)
+
serializer = WorkspaceEstimateSerializer(estimates, many=True)
return Response(serializer.data, status=status.HTTP_200_OK)