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: filter out the removed cycle from issue detail (#6138)

Bavisetti Narayanb6ab853c57c5
diff --git a/apiserver/plane/app/views/issue/base.py b/apiserver/plane/app/views/issue/base.py
index 3d548aeacc..7c15f91da9 100644
--- a/apiserver/plane/app/views/issue/base.py
+++ b/apiserver/plane/app/views/issue/base.py
@@ -445,12 +445,10 @@ class IssueViewSet(BaseViewSet):
.select_related("workspace", "project", "state", "parent")
.prefetch_related("assignees", "labels", "issue_module__module")
.annotate(
- cycle_id=Case(
- When(
- issue_cycle__cycle__deleted_at__isnull=True,
- then=F("issue_cycle__cycle_id"),
- ),
- default=None,
+ cycle_id=Subquery(
+ CycleIssue.objects.filter(issue=OuterRef("id")).values("cycle_id")[
+ :1
+ ]
)
)
.annotate(