diff --git a/apiserver/plane/api/views/workspace.py b/apiserver/plane/api/views/workspace.py index ce425185e..72f33c2b4 100644 --- a/apiserver/plane/api/views/workspace.py +++ b/apiserver/plane/api/views/workspace.py @@ -116,7 +116,7 @@ class WorkSpaceViewSet(BaseViewSet): ) issue_count = ( - Issue.objects.filter(workspace=OuterRef("id")) + Issue.issue_objects.filter(workspace=OuterRef("id")) .order_by() .annotate(count=Func(F("id"), function="Count")) .values("count") @@ -203,7 +203,7 @@ class UserWorkSpacesEndpoint(BaseAPIView): ) issue_count = ( - Issue.objects.filter(workspace=OuterRef("id")) + Issue.issue_objects.filter(workspace=OuterRef("id")) .order_by() .annotate(count=Func(F("id"), function="Count")) .values("count") @@ -1075,7 +1075,7 @@ class WorkspaceUserProfileStatsEndpoint(BaseAPIView): priority_order = ["urgent", "high", "medium", "low", None] priority_distribution = ( - Issue.objects.filter( + Issue.issue_objects.filter( workspace__slug=slug, assignees__in=[user_id], project__project_projectmember__member=request.user, diff --git a/apiserver/plane/bgtasks/issue_automation_task.py b/apiserver/plane/bgtasks/issue_automation_task.py index e56bda4cc..645772c94 100644 --- a/apiserver/plane/bgtasks/issue_automation_task.py +++ b/apiserver/plane/bgtasks/issue_automation_task.py @@ -32,7 +32,7 @@ def archive_old_issues(): archive_in = project.archive_in # Get all the issues whose updated_at in less that the archive_in month - issues = Issue.objects.filter( + issues = Issue.issue_objects.filter( Q( project=project_id, archived_at__isnull=True, @@ -100,7 +100,7 @@ def close_old_issues(): close_in = project.close_in # Get all the issues whose updated_at in less that the close_in month - issues = Issue.objects.filter( + issues = Issue.issue_objects.filter( Q( project=project_id, archived_at__isnull=True, diff --git a/apiserver/plane/utils/analytics_plot.py b/apiserver/plane/utils/analytics_plot.py index 033452e0d..60e751459 100644 --- a/apiserver/plane/utils/analytics_plot.py +++ b/apiserver/plane/utils/analytics_plot.py @@ -96,7 +96,7 @@ def burndown_plot(queryset, slug, project_id, cycle_id=None, module_id=None): chart_data = {str(date): 0 for date in date_range} completed_issues_distribution = ( - Issue.objects.filter( + Issue.issue_objects.filter( workspace__slug=slug, project_id=project_id, issue_cycle__cycle_id=cycle_id, @@ -118,7 +118,7 @@ def burndown_plot(queryset, slug, project_id, cycle_id=None, module_id=None): chart_data = {str(date): 0 for date in date_range} completed_issues_distribution = ( - Issue.objects.filter( + Issue.issue_objects.filter( workspace__slug=slug, project_id=project_id, issue_module__module_id=module_id,