chore: filter out the removed cycle from issue detail (#6138)

This commit is contained in:
Bavisetti Narayan 2024-12-03 16:48:14 +05:30 committed by GitHub
parent fe43300aa7
commit b6ab853c57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(