diff --git a/apiserver/plane/api/serializers/__init__.py b/apiserver/plane/api/serializers/__init__.py index 683ed9670..34e235e38 100644 --- a/apiserver/plane/api/serializers/__init__.py +++ b/apiserver/plane/api/serializers/__init__.py @@ -18,6 +18,7 @@ from .project import ( ProjectFavoriteSerializer, ProjectLiteSerializer, ProjectMemberLiteSerializer, + ProjectMemberAdminSerializer, ) from .state import StateSerializer, StateLiteSerializer from .view import IssueViewSerializer, IssueViewFavoriteSerializer diff --git a/apiserver/plane/api/serializers/cycle.py b/apiserver/plane/api/serializers/cycle.py index 5b7bb7598..1abd63b7f 100644 --- a/apiserver/plane/api/serializers/cycle.py +++ b/apiserver/plane/api/serializers/cycle.py @@ -41,6 +41,7 @@ class CycleSerializer(BaseSerializer): { "avatar": assignee.avatar, "first_name": assignee.first_name, + "display_name": assignee.display_name, "id": assignee.id, } for issue_cycle in obj.issue_cycle.all() diff --git a/apiserver/plane/api/views/cycle.py b/apiserver/plane/api/views/cycle.py index 268485b6e..885199f83 100644 --- a/apiserver/plane/api/views/cycle.py +++ b/apiserver/plane/api/views/cycle.py @@ -370,7 +370,8 @@ class CycleViewSet(BaseViewSet): .annotate(last_name=F("assignees__last_name")) .annotate(assignee_id=F("assignees__id")) .annotate(avatar=F("assignees__avatar")) - .values("first_name", "last_name", "assignee_id", "avatar") + .annotate(display_name=F("assignees__display_name")) + .values("first_name", "last_name", "assignee_id", "avatar", "display_name") .annotate(total_issues=Count("assignee_id")) .annotate( completed_issues=Count( diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 2a7532ecf..7d60456a0 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -173,8 +173,9 @@ class ModuleViewSet(BaseViewSet): .annotate(first_name=F("assignees__first_name")) .annotate(last_name=F("assignees__last_name")) .annotate(assignee_id=F("assignees__id")) + .annotate(display_name=F("assignees__display_name")) .annotate(avatar=F("assignees__avatar")) - .values("first_name", "last_name", "assignee_id", "avatar") + .values("first_name", "last_name", "assignee_id", "avatar", "display_name") .annotate(total_issues=Count("assignee_id")) .annotate( completed_issues=Count( diff --git a/apiserver/plane/api/views/project.py b/apiserver/plane/api/views/project.py index 98484f74b..5911011b5 100644 --- a/apiserver/plane/api/views/project.py +++ b/apiserver/plane/api/views/project.py @@ -23,6 +23,7 @@ from plane.api.serializers import ( ProjectDetailSerializer, ProjectMemberInviteSerializer, ProjectFavoriteSerializer, + ProjectMemberAdminSerializer, ) from plane.api.permissions import ProjectBasePermission, ProjectEntityPermission @@ -451,7 +452,7 @@ class UserProjectInvitationsViewset(BaseViewSet): class ProjectMemberViewSet(BaseViewSet): - serializer_class = ProjectMemberSerializer + serializer_class = ProjectMemberAdminSerializer model = ProjectMember permission_classes = [ ProjectBasePermission,