diff --git a/apiserver/plane/app/serializers/workspace.py b/apiserver/plane/app/serializers/workspace.py index 69f827c24..b17828f83 100644 --- a/apiserver/plane/app/serializers/workspace.py +++ b/apiserver/plane/app/serializers/workspace.py @@ -18,7 +18,7 @@ from plane.db.models import ( class WorkSpaceSerializer(DynamicBaseSerializer): - owner = UserLiteSerializer(read_only=True) + owner_id = serializers.PrimaryKeyRelatedField(read_only=True) total_members = serializers.IntegerField(read_only=True) total_issues = serializers.IntegerField(read_only=True) @@ -48,7 +48,7 @@ class WorkSpaceSerializer(DynamicBaseSerializer): "updated_by", "created_at", "updated_at", - "owner", + "owner_id", ] diff --git a/apiserver/plane/app/views/workspace.py b/apiserver/plane/app/views/workspace.py index f4d3dbbb5..dc0c17cbf 100644 --- a/apiserver/plane/app/views/workspace.py +++ b/apiserver/plane/app/views/workspace.py @@ -69,7 +69,6 @@ from plane.db.models import ( Label, WorkspaceMember, CycleIssue, - IssueReaction, WorkspaceUserProperties, Estimate, EstimatePoint, @@ -80,7 +79,6 @@ from plane.app.permissions import ( WorkspaceEntityPermission, WorkspaceViewerPermission, WorkspaceUserPermission, - ProjectLitePermission, ) from plane.bgtasks.workspace_invitation_task import workspace_invitation from plane.utils.issue_filters import issue_filters @@ -114,13 +112,6 @@ class WorkSpaceViewSet(BaseViewSet): .annotate(count=Func(F("id"), function="Count")) .values("count") ) - - issue_count = ( - Issue.issue_objects.filter(workspace=OuterRef("id")) - .order_by() - .annotate(count=Func(F("id"), function="Count")) - .values("count") - ) return ( self.filter_queryset( super().get_queryset().select_related("owner") @@ -131,8 +122,6 @@ class WorkSpaceViewSet(BaseViewSet): workspace_member__is_active=True, ) .annotate(total_members=member_count) - .annotate(total_issues=issue_count) - .select_related("owner") ) def create(self, request):