forked from github/plane
fix: project members endpoint email (#1804)
* fix: project members endpoint email * dev: cycle and module assignee display name
This commit is contained in:
parent
2769a73898
commit
085cd1960e
@ -18,6 +18,7 @@ from .project import (
|
|||||||
ProjectFavoriteSerializer,
|
ProjectFavoriteSerializer,
|
||||||
ProjectLiteSerializer,
|
ProjectLiteSerializer,
|
||||||
ProjectMemberLiteSerializer,
|
ProjectMemberLiteSerializer,
|
||||||
|
ProjectMemberAdminSerializer,
|
||||||
)
|
)
|
||||||
from .state import StateSerializer, StateLiteSerializer
|
from .state import StateSerializer, StateLiteSerializer
|
||||||
from .view import IssueViewSerializer, IssueViewFavoriteSerializer
|
from .view import IssueViewSerializer, IssueViewFavoriteSerializer
|
||||||
|
@ -41,6 +41,7 @@ class CycleSerializer(BaseSerializer):
|
|||||||
{
|
{
|
||||||
"avatar": assignee.avatar,
|
"avatar": assignee.avatar,
|
||||||
"first_name": assignee.first_name,
|
"first_name": assignee.first_name,
|
||||||
|
"display_name": assignee.display_name,
|
||||||
"id": assignee.id,
|
"id": assignee.id,
|
||||||
}
|
}
|
||||||
for issue_cycle in obj.issue_cycle.all()
|
for issue_cycle in obj.issue_cycle.all()
|
||||||
|
@ -370,7 +370,8 @@ class CycleViewSet(BaseViewSet):
|
|||||||
.annotate(last_name=F("assignees__last_name"))
|
.annotate(last_name=F("assignees__last_name"))
|
||||||
.annotate(assignee_id=F("assignees__id"))
|
.annotate(assignee_id=F("assignees__id"))
|
||||||
.annotate(avatar=F("assignees__avatar"))
|
.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(total_issues=Count("assignee_id"))
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
|
@ -173,8 +173,9 @@ class ModuleViewSet(BaseViewSet):
|
|||||||
.annotate(first_name=F("assignees__first_name"))
|
.annotate(first_name=F("assignees__first_name"))
|
||||||
.annotate(last_name=F("assignees__last_name"))
|
.annotate(last_name=F("assignees__last_name"))
|
||||||
.annotate(assignee_id=F("assignees__id"))
|
.annotate(assignee_id=F("assignees__id"))
|
||||||
|
.annotate(display_name=F("assignees__display_name"))
|
||||||
.annotate(avatar=F("assignees__avatar"))
|
.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(total_issues=Count("assignee_id"))
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
|
@ -23,6 +23,7 @@ from plane.api.serializers import (
|
|||||||
ProjectDetailSerializer,
|
ProjectDetailSerializer,
|
||||||
ProjectMemberInviteSerializer,
|
ProjectMemberInviteSerializer,
|
||||||
ProjectFavoriteSerializer,
|
ProjectFavoriteSerializer,
|
||||||
|
ProjectMemberAdminSerializer,
|
||||||
)
|
)
|
||||||
|
|
||||||
from plane.api.permissions import ProjectBasePermission, ProjectEntityPermission
|
from plane.api.permissions import ProjectBasePermission, ProjectEntityPermission
|
||||||
@ -451,7 +452,7 @@ class UserProjectInvitationsViewset(BaseViewSet):
|
|||||||
|
|
||||||
|
|
||||||
class ProjectMemberViewSet(BaseViewSet):
|
class ProjectMemberViewSet(BaseViewSet):
|
||||||
serializer_class = ProjectMemberSerializer
|
serializer_class = ProjectMemberAdminSerializer
|
||||||
model = ProjectMember
|
model = ProjectMember
|
||||||
permission_classes = [
|
permission_classes = [
|
||||||
ProjectBasePermission,
|
ProjectBasePermission,
|
||||||
|
Loading…
Reference in New Issue
Block a user